.net - MSBuild 错误 MSB3086,与 TeamCity

标签 .net msbuild windows-server-2008 teamcity microsoft-web-deploy

我正在尝试构建和部署 .NET 4项目使用 MSBuild Web 部署和 TeamCity ,我在本地开发机器上运行了一个 TeamCity 实例,我得到了这个工作正常(最终),但是当我尝试使用相同的设置设置一个新的 TeamCity 实例时,我收到以下错误:

\Microsoft.Common.targets(2249, 9): error MSB3086: Task could not find "sgen.exe" 
using the SdkToolsPath 
"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\" or the 
registry key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A".
Make sure the SdkToolsPath is set and the tool exists in the correct processor 
specific location under the SdkToolsPath and that the Microsoft Windows SDK 
is installed 

我正在运行 Windows Server 2008,并安装了 .NET 4,包括(我相信)MSBuild 4。我还安装了 Windows SDK 7.1,因为其他线程建议这可能是问题所在,但仍然没有运气。任何想法或建议将不胜感激。

谢谢

最佳答案

我在 TeamCity 上遇到了同样的问题。以下是我的解决步骤:

  • 下载适用于 Windows 7.1 的 Windows SDK。如果您的服务器/用户不允许 Web 访问,Web installer不起作用,所以我推荐 full package download .小心下载正确的版本——x86 [32 位]、x64 [64 位] 或 Itanium。
  • 安装时只需要选择一个选项: .NET 开发 -> 工具
    enter image description here
  • 再次尝试构建。我不需要重新启动我的代理以使构建正常工作。

  • 如果您接受默认安装路径, sgen.exe 将在这里找到:
    C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\sgen.exe
    

    关于.net - MSBuild 错误 MSB3086,与 TeamCity,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8140413/

    相关文章:

    c# - 如何保存控制台应用程序的输出

    .net - 如何将自定义 nuget feed 添加到 TeamCity 构建?

    asp.net - IIS 7.0删除子目录时如何防止AppDomain回收?

    windows-services - jenkins 服务无法在 Windows 2008 上启动

    .net - 有没有通过 .net 读取颠覆存储库的工具?

    c# - Windows 桌面应用程序的本地化

    .net - 在命令行中使用 MSBuild 重建解决方案失败,但 Visual Studio 重建工作正常

    msbuild - 设置 MSBuild 任务的输出路径

    iis-7 - ASP.DLL 内存泄漏(或其他)迫使 w3wp 不断重启

    c# - 为 COM DLL 创建 .NET 包装器的工具?