You can use the Windows 7.1 SDK platform toolset to target the.NET Framework 2.0, 3.0, 3.5, and 4, and the x86/x64 platforms. You can extend the target platform further by creating a custom platform toolset. For more information, see C Native Multi-Targeting on the Visual C blog. To change the target Framework.
Platform Tools Windows
-->You can edit a Visual Studio C++ project file to target different versions of the C++ platform toolset, the Windows SDK and the .NET Framework (C++/CLI projects only). By default, the project system uses the .NET Framework version and the toolset version that correspond to the version of Visual Studio that you use to create the project. You can modify all these values in the .vcxproj file so that you can use the same code base for every compilation target.
Platform toolset
The platform toolset consists of the C++ compiler (cl.exe) and linker (link.exe), along with the C/C++ standard libraries. Since Visual Studio 2015, the major version of the toolset has remained at 14, which means that projects compiled with Visual Studio 2019 or Visual Studio 2017 are ABI-backwards-compatible with projects compiled with Visual Studio 2015. The minor version has updated by 1 for each version since Visual Studio 2015:
- Visual Studio 2015: v140
- Visual Studio 2017: v141
- Visual Studio 2019: v142
These toolsets support .NET Framework 4.5 and later.
Visual Studio also supports multitargeting for C++ projects. You can use the Visual Studio IDE to edit and build projects that were created with older versions of Visual Studio, without upgrading them to use a new version of the toolset. You do need to have the older toolsets installed on your computer. For more information, see How to use native multi-targeting in Visual Studio. For example, in Visual Studio 2015, you can target .NET Framework 2.0 but you must use an earlier toolset that supports it.
Target framework (C++/CLI project only)
When you change the target Framework, also change the platform toolset to a version that supports that Framework. For example, to target the .NET Framework 4.5, you must use a compatible platform toolset such as Visual Studio 2015 (v140), Visual Studio 2013 (v120) or Visual Studio 2012 (v110). You can use the Windows 7.1 SDK platform toolset to target the .NET Framework 2.0, 3.0, 3.5, and 4, and the x86/x64 platforms.
You can extend the target platform further by creating a custom platform toolset. For more information, see C++ Native Multi-Targeting on the Visual C++ blog.
To change the target Framework
- In Visual Studio, in Solution Explorer, select your project. On the menu bar, open the Project menu and choose Unload project. This unloads the project (.vcxproj) file for your project.NoteA 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
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
in the<PropertyGroup Label='Globals'>
element of the<Project>
element. If the<TargetFrameworkVersion>
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, such as v3.5 or v4.6.
- Save the changes and close the editor.
- In Solution Explorer, open the shortcut menu for your project and then choose Reload Project.
- To verify the change, in Solution Explorer, right-click to open the shortcut menu for your project (not for your solution) and then choose Properties to open your project Property Pages dialog box. In the left pane of the dialog box, expand Configuration Properties and then select General. Verify that .NET Target Framework Version shows the new Framework version.
To change the platform toolset
- In Visual Studio, in Solution Explorer, open the shortcut menu for your project (not for your solution) and then choose Properties to open your project Property Pages dialog box.
- 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 have installed the Visual Studio 2010 toolset, select Visual Studio 2010 (v100) to use it for your project.
- Choose the OK button.
See also
Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upHave a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
commented Feb 19, 2018 • edited
edited
Hosted 2017 ought to support the v141 toolset, but it appears only v140 is installed: ##[warning]Visual Studio version '15.0' not found. Falling back to version '14.0'. ##[error]C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V140Microsoft.Cpp.Platform.targets(57,5): Error MSB8020: The build tools for v141 (Platform Toolset = 'v141') cannot be found. To build using the v141 build tools, please install v141 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting 'Retarget solution'. Can we get v141 installed on Hosted 2017? |
commented Feb 19, 2018
The hosted image is updated on a monthly basis pulling the latest VS. So when VS updates to 141, the next monthly image will carry it. |
commented Feb 19, 2018 • edited
edited
This was working in my CI release on 2-1, the last time I checked in to my project. I queued a CI build today and it fails with this error. Clearly the hosted 2017 image DID have v141 and now it does not. Do we know which checkin broke this and which one will be fixing it? Further - I checked my nightly builds, which are apparently not running nightly. But the build on 2/6 succeeded. The build on 2/13 failed. So the break happened some time in there |
commented Feb 19, 2018
Platform Toolset 141 Download Windows 7
@stephenegriffin - thanks. As a guess, I would say VS updates ran in one case and in the other it didn't. But that's just a guess. We will investigate. VS Updates shouldn't run once the image is provisioned into the pool. Nothing changed in the install script so this is something dynamic: https://github.com/Microsoft/vsts-image-generation/commits/master/images/win/scripts/Installers/Vs2017/Install-VS2017.ps1 |
changed the titlePlatform Toolset v141 MissingFeb 19, 2018
Platform Toolset 141 Download For Mac
added the status:Approved label Feb 19, 2018
assigned lokesh755Feb 19, 2018
commented Feb 20, 2018
So - I was digging a bit more on this. I found the Agent Queues which shows me which pools my builds are queuing in. Despite having the default queue of Hosted VS2017 selected on my build definitions, it looks like all of my builds are queuing in Hosted instead. That explains the lack of capabilities. But something is definitely wrong with how my agents are being selected. There's still a bug here, but now I don't know where it is. |
commented Feb 20, 2018
I have filed this: https://developercommunity.visualstudio.com/content/problem/200822/hosted-vs2017-builds-queuing-in-hosted-agents.html |
commented Feb 23, 2018
Closing this issue since it's unrelated image-generation process. |
closed this Feb 23, 2018
commented Jul 13, 2018 • edited
edited
It appeared to me, that the reason for the problem was a not needed VCTargetsPath system variable. After removing it, VS 2017 now sees V141 toolset. I had VS 2017 Community first, maybe that made the problem. |
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment