Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio 2012 使用新生成定义生成时发生MSBuild错误_Visual Studio 2012_Msbuild - Fatal编程技术网

Visual studio 2012 使用新生成定义生成时发生MSBuild错误

Visual studio 2012 使用新生成定义生成时发生MSBuild错误,visual-studio-2012,msbuild,Visual Studio 2012,Msbuild,我们正在与连接到TFS2012的VS2008合作。我们要求,如果任何人签入更改,则必须将最新版本的文件复制到未映射到TFS的中心文件夹。我做了一些搜索,然后我发现如果我们可以用构建事件来实现这一点,那么我所要做的就是创建新的构建定义,并在签入时触发。我无法在VS2008中创建构建定义,所以我在VS2012中创建了构建定义,但在使用该定义构建时,会出现如下错误 Debug | Any CPU 1 error(s), 3 warning(s) $/Global Module/cal_reg.sln

我们正在与连接到TFS2012的VS2008合作。我们要求,如果任何人签入更改,则必须将最新版本的文件复制到未映射到TFS的中心文件夹。我做了一些搜索,然后我发现如果我们可以用构建事件来实现这一点,那么我所要做的就是创建新的构建定义,并在签入时触发。我无法在VS2008中创建构建定义,所以我在VS2012中创建了构建定义,但在使用该定义构建时,会出现如下错误

Debug | Any CPU
 1 error(s), 3 warning(s)
$/Global Module/cal_reg.sln - 1 error(s), 3 warning(s), View Log File
 C:\Windows\Microsoft.NET\Framework64\v3.5\Microsoft.Common.targets (1418): Task failed because "AxImp.exe" was not found, or the correct Microsoft Windows SDK is not installed. The task is looking for "AxImp.exe" in the "bin" subdirectory beneath the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx35Tools-x86. You may be able to solve the problem by doing one of the following:  1) Install the Microsoft Windows SDK.  2) Install Visual Studio 2010.  3) Manually set the above registry key to the correct location.  4) Pass the correct location into the "ToolPath" parameter of the task.
 C:\Windows\Microsoft.NET\Framework64\v3.5\Microsoft.Common.targets: Could not resolve this reference. Could not locate the assembly "CommonProc". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
 C:\Windows\Microsoft.NET\Framework64\v3.5\Microsoft.Common.targets: Could not resolve this reference. Could not locate the assembly "Interop.Word". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
 C:\Windows\Microsoft.NET\Framework64\v3.5\Microsoft.Common.targets: Could not resolve this reference. Could not locate the assembly "Interop.Excel". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
 $/Global Module/cal_reg.sln compiled
 No Test Results
 No Code Coverage Results
Other Errors and Warnings
 1 error(s), 0 warning(s)
 Exception Message: MSBuild error 1 has ended this build. You can find more specific information about the cause of this error in above messages. (type BuildProcessTerminateException)
Exception Stack Trace:    at System.Activities.Statements.Throw.Execute(CodeActivityContext context)
   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

我尝试使用MSBuild.exe在命令行中生成,但发生了相同的错误。为什么会发生这种情况?该怎么办?

好的,答案在生成日志中:

C:\Windows\Microsoft.NET\Framework64\v3.5\Microsoft.Common.targets (1418): Task failed because "AxImp.exe" was not found, or the correct Microsoft Windows SDK is not installed. The task is looking for "AxImp.exe" in the "bin" subdirectory beneath the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx35Tools-x86. 
You may be able to solve the problem by doing one of the following:  
1) Install the Microsoft Windows SDK.  
2) Install Visual Studio 2010.  
3) Manually set the above registry key to the correct location.  
4) Pass the correct location into the "ToolPath" parameter of the task.

答案在您的构建日志中:

C:\Windows\Microsoft.NET\Framework64\v3.5\Microsoft.Common.targets (1418): Task failed because "AxImp.exe" was not found, or the correct Microsoft Windows SDK is not installed. The task is looking for "AxImp.exe" in the "bin" subdirectory beneath the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0A\WinSDK-NetFx35Tools-x86. 
You may be able to solve the problem by doing one of the following:  
1) Install the Microsoft Windows SDK.  
2) Install Visual Studio 2010.  
3) Manually set the above registry key to the correct location.  
4) Pass the correct location into the "ToolPath" parameter of the task.

Microsoft Windows SDK已安装,路径已设置为注册表中的正确位置,并且在Microsoft.Common.targets文件中设置了ToolPath=“$(LCToolPath)”Microsoft Windows SDK已安装,路径已设置为注册表中的正确位置,在Microsoft.Common.targets文件中设置了ToolPath=“$(LCToolPath)”