且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么Visual Studio 2013使用错误的SdkToolsPath for lc.exe?

更新时间:2022-04-30 10:36:03

事实证明,您可以直接在.csproj文件中指定SDK的路径:

It turns out you can specify the path to the SDK directly in the .csproj file:

<TargetFrameworkSDKToolsDirectory>C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools</TargetFrameworkSDKToolsDirectory>

,然后该版本以这种方式找到了lc.exe.

and the build found lc.exe that way.

我以前曾期望使用<SdkToolsPath>进行设置,但这没有用.在Microsoft.Common.targets中,从TargetFrameworkSDKToolsDirectory设置了SdkToolsPath,所以我尝试了一下并成功了.这是在Visual Studio 2015上,并且从ant调用了msbuild.

I previously expected to set this using <SdkToolsPath>, but that didn't work. In Microsoft.Common.targets, SdkToolsPath gets set from TargetFrameworkSDKToolsDirectory, so I tried that and it worked. This is on Visual Studio 2015, and msbuild being called from ant.

通过找到的解决方案使用不正确版本的sgen.exe来生成XmlSerializer dll的MSBuild?