简体   繁体   English

带有C#项目的Visual Studio 12 Professional中的编译问题

[英]Compilation issue in Visual Studio 12 Professional with a C# project

The project worked fine in Visual Studio 2010, and we upgraded to Visual Studio 2012; 该项目在Visual Studio 2010中运行良好,我们升级到Visual Studio 2012; however, now it does not compile. 但是,现在它没有编译。

We get the following error: 我们收到以下错误:

Error 2 Task could not find "AL.exe" using the SdkToolsPath "" or the registry key "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0A\\WinSDK-NetFx40Tools-x86". 错误2任务无法使用SdkToolsPath“”或注册表项“HKEY_LOCAL_MACHINE \\ SOFTWARE \\ Microsoft \\ Microsoft SDKs \\ Windows \\ v8.0A \\ WinSDK-NetFx40Tools-x86”找到“AL.exe”。 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 PROJECT_NAME 确保已设置SdkToolsPath,并且该工具位于SdkToolsPath下正确的处理器特定位置,并且安装了Microsoft Windows SDK PROJECT_NAME

Does anyone how to solve this issue? 有人怎么解决这个问题?

I am on Windows 2008 R2 SP1 with .NET 4.5 installed. 我在安装了.NET 4.5的Windows 2008 R2 SP1上。 I did not install .NET 4 directly, I used the .NET 4.5 installer. 我没有直接安装.NET 4,我使用的是.NET 4.5安装程序。

I fixed this by installing "Windows Software Development Kit (SDK) for Windows 8" from http://msdn.microsoft.com/en-us/windows/hardware/hh852363.aspx 我通过从http://msdn.microsoft.com/en-us/windows/hardware/hh852363.aspx安装“适用于Windows 8的Windows软件开发工具包(SDK)”来解决此问题。

I was confused by the title - I'm on Windows 7 - but it worked. 我对标题感到困惑 - 我在Windows 7上 - 但它确实有效。

Solution pointed by Mark Rainey worked for us: http://www.markrainey.me/2013/02/setting-up-build-machine.html Mark Rainey指出的解决方案为我们工作: http//www.markrainey.me/2013/02/setting-up-build-machine.html

Changing sdk version 改变sdk版本

 Go to "Microsoft Windows SDK v7.1" from the Start menu Select "Windows SDK 7.1 Command Prompt" and enter > cd Setup > WindowsSdkVer -version:v7.1 

My issue was when clicking on Properties on the solution for the Active(Debug) configuration, the configuration for my projects were set to Release . 我的问题是当单击Active(Debug)配置解决方案上的Properties时,我的项目配置被设置为Release Changed it to Debug , rebuilt and the build error disappeared. 将其更改为Debug ,重建并且构建错误消失。

After 2013 now msbuild is part of VS. 2013年之后,msbuild成为VS的一部分。

https://blogs.msdn.microsoft.com/visualstudio/2013/07/24/msbuild-is-now-part-of-visual-studio/ https://blogs.msdn.microsoft.com/visualstudio/2013/07/24/msbuild-is-now-part-of-visual-studio/

On my case I had to change the msbuild path after I installed VS2015 to 在我的情况下,我必须在安装VS2015之后更改msbuild路径

C:\\Program Files (x86)\\MSBuild\\14.0\\Bin\\ C:\\ Program Files(x86)\\ MSBuild \\ 14.0 \\ Bin \\

"I fixed this by installing "Windows Software Development Kit (SDK) for Windows 8" from http://msdn.microsoft.com/en-us/windows/hardware/hh852363.aspx " “我通过从http://msdn.microsoft.com/en-us/windows/hardware/hh852363.aspx安装”适用于Windows 8的Windows软件开发工具包(SDK)“来修复此问题。”

This solution by user489998 worked fine on Windows server 2008 R2 as well. user489998的这个解决方案在Windows Server 2008 R2上运行良好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 不使用Visual Studio编译.NET 4.6 C#项目 - Compilation of .NET 4.6 C# project without Visual Studio 没有visual studio的C#编译 - C# Compilation without visual studio Visual Studio(C#)中的条件编译 - Conditional Compilation in Visual Studio(C#) Visual Studio 2017 Professional中的WebTest项目 - WebTest Project in Visual studio 2017 professional 为什么在Visual Studio中对一个简单的C#项目进行第一次编译会花费这么长时间? - Why does the first compilation of a simple C# project in Visual Studio take so long? Windows Visual Studio Professional 中的 CLI 项目 - Windows CLI Project in Visual Studio Professional Visual Studio Professional 2010:停止将“new {”从自动填充到“new object {”(C#) - Visual Studio Professional 2010: Stop “new {” from autocompleting into “new object {” (C#) VSTO Excel加载项C#的安装文件(Visual Studio Professional 2017) - Setup File For VSTO Excel Add-In C# (Visual Studio Professional 2017) 在visual studio professional 2010上使用试用版部署Web应用程序c# - Deploying a web application using the trial version on visual studio professional 2010 c# 如何检测 c# Visual Studio 2008 Professional 中是否使用了资源字符串? - How to detect if resource string is used in c# visual studio 2008 professional?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM