mikefourie-zz / MSBuildExplorer

MSBuild Explorer
159 stars 23 forks source link

VCTargetsPath not set #3

Open adambadura opened 9 years ago

adambadura commented 9 years ago

I just installed version 3 of the application. And used it to open Visual Studio C++ project. And it faild. MSBuild Explorer was unable to resolve:

<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

Judging by message the problem was that $(VCTargetsPath) was not defined.

At the same time the project works just fine from Visual Studio.

I use Visual Studio 2013 Express edition on recently updated Windows 10 (previously Windows 7).

My workaround was to create a .cmd script (in the directory that holds start menu shortcuts) that does this:

SET VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120
"MSBuild Explorer 3.appref-ms"

It does work well. MSBuild Explorer opened that way is able to open the C++ project normally. (But for some reason the .cmd file doesn't show up in start menu - must be Windows 10 thing...)

duncanlees commented 9 years ago

The issue is that the tool is built against the old v4.0 framework that was part of Visual Studio 2010. Because of this, it's using the MSBuild assemblies which define the $(VCTargetsPath) property to point to the directory for VS2010, rather than VS2013 as you need.

If you build against v4.5, you'll find the correct path for VC is used instead.

TurkeyMan commented 7 years ago

I have vs2015 installed, only v4.0 ... what is this v4.5 you speak of?