Unload unsupported/incompatible Project in Visual Studio 2017 - visual-studio-2017

On a project that is not loaded because of a missing addin/application the "Unload Project" menu item is disabled on the projects context menu. A "migration error report" is shown each time when loading the solution where "lightwight solution load" is not enabled. So there seems to be no way to tell VS to ignore these projects while loading the solution. Not all members of the team have the licence for these addins (Sandcastle, WIX, ...) or do not want to install them.

Related

"Manage Client-Side Libraries" menu not appearing

I'm trying to use the new Library Manager (LibMan) feature in Visual Studio 2017 (I'm using Version 15.7.1) but it is not appearing on either the project context menu or the Project menu.
I have tried various web projects but I can't see it for any of them. The only project type I haven't tried is ASP.NET Core 2.1 (I don't have the preview installed) but I can't find any docs that say it only works with ASP.NET Core 2.1
Here is a screenshot to prove it's not there:
had the same issue. I found the answer two it on another site, but for the life of me cannot find it for reference right now. The easiest thing to do is to build it yourself and install it. Works perfectly fine, I did it and now have the Manage Client Side libraries showing up.
Clone / download the Library Manager from GitHub. (https://github.com/aspnet/LibraryManager/)
Build it in Visual Studio 2017
Run the .Vsix installer
Begin to use the Manage Client Side Libraries from the context menu or project menu.
Hope this helps.
For me, in VS 2022 the context menu option appears but the dialog doesn't show. I found out that instead of right-clicking on project item i have to right-click on wwwroot item and then the dialog is shown
Even though Visual Studio Community 15.7.5 references the "Library Manager" it looks like it is still in Preview and to be released with VS 15.8.
If you would like to use the Library Manager now it is fairly easy but there are a few work arounds right now to get it to install, probably a reason it is still in Preview.
Clone or Download the source code
Note: This requires the Visual Studio extension development Workload to be installed (Tools -> Get Tools and Features under "Other Toolsets").
According to this issue on GitHub it will not install, before compiling the Extension open the project file for the LibraryManager.Vsix project
[LibraryManagerDir]\src\LibraryManager.Vsix\Microsoft.Web.LibraryManager.Vsix.csproj
and update (line #30)
<IsProductComponent>false</IsProductComponent>
After 15.8 comes out this needs to be reset back to true to be able to install it.
Open the LibraryManager.sln and make sure to change the Configuration to Release and Build the Solution.
This will create a .vsix install file:
[LibraryManagerDir]\src\LibraryManager.Vsix\bin\Release\Microsoft.Web.LibraryManager.vsix
Open Microsoft.Web.LibraryManager.vsix to launch the Visual Studio Installer.
Then you will have the Add->Client Side Library in your Context Menu.

Visual Studio 2015 startup projects list without extension

In Visual Studio 2015 Community Edition there's an option to have a dropdown list for startup projects.
Startup project option
In a sample project coming from Microsoft the list is available and I can choose from two startup projects - I don't need any extensions on this. Dropdown list with startup projects
In case of my own project the option is ticked but there's no list like in the sample project.
Do somebody know how to get that list? I've searched for options in the solution and project properties without luck.
The mentioned sample project can be found on the following link: Geolocation sample

MFC development in vs2017

When I installed vs2017, I did select Windows development with C++ option. After installation, however, I don't see the MFC has been added. Sure enough, I get errors when I compile my application,
fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory
I cannot find the Change/Modify option with my vs2017 installation in Control Panel. How can I add "Microsoft Foundation Classes for C++" package?
If you look near the top of the VS Installer window, you'll see Workloads, Individual Components and Language Packs.
At least as far as I can see, none of the "Workloads" will include MFC in your installation. To get it, you first have to click on "Individual Components", then scroll quite a ways down to get to the "SDKs, libraries and frameworks" section. In there, you'll find a list of components for ATL and MFC support:
In the VS 2019 installer, the list of possibilities has gotten even longer. There are versions for ARM, ARM64, and x86/x64 both with and without Spectre mitigations, for each of the 141 and 142 build sets:
That's not necessarily the end of the story though: by default, even when you install that, it only installs the version Unicode build of MFC. If you want the narrow-character version, you have to install that separately. I don't think there's any entry in the installer to do this at all--but if you try to build a project that uses narrow-character MFC, you'll get an error message that includes a link to download it.
In Windows 10 with Visual Studio 2017 Community Edition to modify the Visual Studio 2017 installation, I had to go into Settings from the Windows Start menu then in the search box enter "Apps & Features" to bring up the list of installed applications (just typing in "apps" was enough to bring it up in the list).
I then looked for Microsoft Visual Studio 2017 in the list of apps, clicked on that entry which then displayed the Modify button. Clicking on the Modify button will bring up the installer to allow you to modify the various components.
I have seen cases where the installer wants to do an Update of Visual Studio 2017 before allowing you to do the Modify action. Depends on the last time you used it and the last time you did an update.
So instead of a Modify button there may instead be an Update button.
Note: see also How to install (v142) Build tools in Visual studio which describes issues seen with install order when installing both VS 2017 and VS 2019.
The VS 2017 Modify dialog has three tabs, "Workloads", "Individual components", and "Language packs". Click on the "Individual components" then scroll down to the section titled "SDKs, libraries, and frameworks" which is the last section in my install. There should be an entry for "MFC and ATL support (x86 and x64)" with a checkbox near the end.
There is a lot of stuff available from this "Individual components" view of the "Modify installation" dialog.
Just to add a tip for VS 2019:
#Jerry Coffin's answer does a good job of laying out the explosion of MFC/ATL options in VS 2019. Since there are many options and each MFC pack is 1.1+GB, here is how to pick the right one.
Platform: Hopefully you know this :) but it is in project properties.
Version: For an existing project, it is found in the project properties under "Configuration Properties -> General -> Platform Toolset"
Below is a screenshot showing both (Win32=x86 in this case). In this case I needed "C++ MFC for v141 build tools (x86 & x64)":
You should use Visual Studio Installer to make changes.
To create an MFC project, you just need to select Win32 project/Win32 Console Application for your application type, and then click OK. In Application Wizard, click next, in Application Settings, check MFC under Add common header files for:.

Using Visual Studio 2012 IDE, but compile with Visual Studio 2008

Where I work, we are stuck on VS2008 and will be for quite some time as converting the projects/solutions and integrating them back into our build process would take significant time; we're planning on moving to 2013 at some point though. However, I use VS2012 at home and love a lot of the features in the IDE that are missing in 2008.
I've read that you can use 2012 as an IDE and build with the 2008 compiler, but I can't find details on how this is accomplished. Any ideas? If I open one of the masterbuild files in 2012, it inevitably asks to convert them to the 2012 format, which I really don't want to do.
Thoughts? Thanks!
Yes it is possible as can be found on the Visual Studio site. However, I believe it will only give you options of the versions you have currently installed on the machine in question.
Here are the steps as laid out in the link, provided here to ensure the information link does not get broken:
(authored and published by Microsoft)
To change the target Framework
In Visual Studio, in Solution Explorer, open the shortcut menu for your project and then choose Unload project. This unloads the project (.vcxproj) file for your project.
Note: A C++ project cannot be loaded while the project file is being modified in Visual Studio. However, you can use another editor such as Notepad to modify the project file while the project is loaded in Visual Studio. Visual Studio will detect that the project file has changed and prompt you to reload the project.
On the menu bar, select File, Open, File. In the Open File dialog box, navigate to your project folder, and then open the project (.vcxproj) file.
In the project file, locate the entry for the target Framework version. For example, if your project is designed to use the .NET Framework 4.5, locate v4.5 in the element of the element. If the element isn't present, your project doesn't use the .NET Framework and no change is required.
Change the value to the Framework version you want.
Save the changes and close the editor.
In Solution Explorer, open the shortcut menu for your project and then choose Reload Project.
In Solution Explorer, open the shortcut menu for your project and then choose Properties. In the Property Pages dialog box, in the left pane, expand Common Properties and then select Framework and References. Verify that Targeted framework shows the new Framework version.
To change the project toolset
In Visual Studio, in Solution Explorer, open the shortcut menu for your project and then choose Properties.
In the Property Pages dialog box, open the Configuration drop-down list and then select All Configurations.
In the left pane of the dialog box, expand Configuration Properties and then select General.
In the right pane, select Platform Toolset and then select the toolset you want from the drop-down list. For example, if you want to compile with the Visual Studio 2010 toolset, select Visual Studio 2010 (v100).
Choose the OK button.
Try to use CMake. It could manage out of source build. You could create a VS2012 for edit and another VS2008 based for compiling. The source will be common.
From Visual Studio 2012 Compatibility page on MSDN
Some solutions, projects, files, and other assets that you created in
Visual Studio 2010 Service Pack 1 (SP1) will run without modification
in Visual Studio 2012, but others have to be upgraded.
If your original project is 2008 then you won't be able to use it in 2012, sorry.

How could I know which bit-version of C++ program I'm building in VS2008?

As the subject says, I'm building my C++ program in Visual Studio 2008. But how could I know if the program built is targeted to 32-bit or 64-bit? I looked around the project properties but couldn't find an option to specify this.
I looked at this article: In Visual Studio, how to correctly build an application for 64-bit machines? But it looks like discussing about C# - I couldn't find any "Any CPU"-like configurations.
Open Visual Studio 2008
Load your project
Once your project is loaded, the VS2008 toolbar should look something like this:
Drop down the list that says "Win32" and choose "Configuration Manager...". This will open the Configuration Manager dialog:
Under "Active Solution Platform", click the drop down list
Select ""
The "New Solution Platform" opens:
Click on the top drop-down (labeled "Type or select the new platform:")
One of the options, at the bottom of the list, should read "x64". Select it.
In the "Copy settings from:" drop-down, choose ""
Check the "Create new project platforms" checkbox
Press the "OK" button
The New Solution Platform dialog closes, and now the x64 platform will be available for you to use in the Configuration Manager dialog.
In the Configuration Manager dialog, for each project in your solution, choose the appropriate platform:
Keep in mind that once you have the x64 platform added to Configuration Manager, you'll probably have to setup appropriate configurations (Release, etc.)