且构网

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

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

更新时间:2022-04-11 10:38:44

原来你可以直接在 .csproj 文件中指定 SDK 的路径:

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

C:Program Files (x86)Microsoft SDKsWindowsv10.0AinNETFX 4.6 Tools

并且构建以这种方式找到了 lc.exe.

and the build found lc.exe that way.

我之前希望使用 <SdkToolsPath> 进行设置,但这不起作用.在 Microsoft.Common.targets 中,SdkToolsPath 是从 TargetFrameworkSDKToolsDirectory 设置的,所以我尝试了它并且它起作用了.这是在 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.

通过 找到的解决方案MSBuild 使用错误版本的 sgen.exe 生成 XmlSerializer dll?