如何在Windows 2003 Server中将Windows SDK与dotnet Framework v4.0.30319的msbuild集成?

问题描述

| 我有一个持续集成服务器(Windows 2003),在部署之前,我在其中构建源代码。使用dotnet框架v4.0.30319中提供的msbuild构建使用dotnet framework 4.0开发的我的源代码之一时,它显示以下错误
C:\\WINDOWS\\Microsoft.NET\\Framework\\v4.0.30319\\Microsoft.Common.targets (2249,9):

errorMSB3086: Task Could not find \"sgen.exe\" using the SdkToolsPath \"\" 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
当我搜索错误时,我得到的建议很少:
   1.Install visual studio 2010 (can\'t do this as it is not a development environment)
   2.create the simillar sdk folder structure as in local machine in the server and make necessary registry confihurations (a bit complex,is it?)
   3. Install sdk component seperatly (Is this a suitable option?).
如果我升级框架,是否可以获取SDK?如果是这样,我如何升级框架以获取最新的msbuild版本?     

解决方法

        需要在构建计算机上安装.Net SDK \。您如何做取决于您。将来,如果您需要msbuild,则很可能需要安装Visual Studio(这似乎是从VS 2013起)。对于早期版本的SDK,您可以查看以下链接,以了解在何处下载SDK。 https://zh.wikipedia.org/wiki/Microsoft_Windows_SDK 在构建系统上安装合适的独立SDK,一切都会正确进行。 还要了解更多信息: 对该键的引用适用于Visual Studio 2010。
HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.0A
在生成计算机上安装\“ Microsoft Windows SDK for Windows 7(7.1.7600.0.30514)\”将使该计算机生成您所关注的源。但是请注意,这些不是等效的SDK(Visual Studio 2010将其SDK称为6.1.7600.16385)。 编辑:也在此处查看最高分答案:运行MSBuild无法读取SDKToolsPath