1

我们的开发团队最近将解决方案从 VS2008 升级到 VS2010,以使用 VS2010 IDE 的一些功能。但我们的目标框架仍然是 .Net 3.5。当 dev 从 VS 2008 命令提示符运行 MSBuild 以构建 VS2010 解决方案时,构建成功。但在构建服务器上,我们收到以下错误。

MSB3086:任务无法使用 SdkToolsPath“”或注册表项“HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A”找到“sgen.exe”。确保设置了 SdkToolsPath 并且该工具存在于 SdkToolsPath 下的正确处理器特定位置,并且 Microsoft Windows SDK 安装在 Microsoft.Common.targets(2249, 9) 中

我们在构建服务器上没有 VS2010 或 Windows SDK 7.1 或 .Net 4.0。此外,我们不想在构建服务器上安装 .Net 4.0 或 VS2010,因为我们希望在生产中继续使用 .Net 3.5。

有什么方法可以修复使用 VS 2008/3.5 MSBuild 运行 VS2010 解决方案,而无需在构建服务器上安装 .Net 4.0 或 VS2010?

谢谢托德

4

2 回答 2

3

If you are using VS2010 for development then you should install .NET 4.0 (MSBuild 4.0) at a minimum on your build server. Your projects can still target .NET 3.5. I would not entertain the idea of trying to get MSBuild 3.5 to build a VS2010 solution file. Just use MSBuild 4.0 and target .NET 3.5.

于 2010-11-11T00:10:40.703 回答
1

根据您是否使用 .Net 4.0 语言功能,一种可能有效的方法是使用Steve Dunn 的 SwitchVsVersion作为构建服务器上构建过程的一部分,将解决方案文件的 Visual Studio 版本更改为 2008。

用法:

SwitchVsVersion.exe <target dir> 2008

将 <target dir> 中的 sln 和 csproj 文件的版本更改为与 Visual Studio 2008 兼容

于 2010-11-10T18:00:37.300 回答