0

I have VS 2010 and VS 2015 installed in my machine. I have a props file at global level.

If I mention the

<PropertyGroup> <PlatformToolset Condition="'$(VisualStudioVersion)'=='14.0'">v140</PlatformToolset> <PlatformToolset Condition="'$(VisualStudioVersion)'=='10.0'">v100</PlatformToolset> </PropertyGroup>

It give the following error while build using VS 2015.

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(518,5): error MSB8008: Specified platform toolset (v140) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected.

But If make same entry in corresponding Vcxproj, it gets successfully build using VS 2015.

Can any one point why it is the issue ?

  • I dont want to change Vcxproj. I am only allow to change propety files. – RAVINDER KUMAR Patel Jul 21 '17 at 07:44
  • Not quite sure, but you could try to invoke `MSBuild.exe` with the `/toolsversion:14.0` option. – Christian.K Jul 21 '17 at 08:54
  • PlatformToolset must be set early in the project file, before the Microsoft.Cpp.props Include. Is that the case? It won't be if you use normal property sheets, they are included later. And though you mention you don't want to change the vcxproj, *the* solution for this (i.e. one vcxproj for different VS versions) is normally to use `$(DefaultPlatformToolset)` in the vcxproj itself. Though I only tried it for VS2012/13/15/17 I suppose it works for 2010 also, and it's automatically correct and doesn't need altering for future VS versions than what you have now. – stijn Jul 21 '17 at 11:03
  • Do you want to build this vcproj file with Visual Studio 2010 or 2015? Since you have install the Visual Studio 2010 and 2015, how about change the platform Toolset to Visual Studio 2010 (v100) manually when you want to build it with Visual Studio 2010? If you do not want to this by manually, you can refer to the stijn`s suggestion. – Leo Liu Jul 24 '17 at 02:25

0 Answers0