简体   繁体   中英

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; 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". 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

Does anyone how to solve this issue?

I am on Windows 2008 R2 SP1 with .NET 4.5 installed. I did not install .NET 4 directly, I used the .NET 4.5 installer.

I fixed this by installing "Windows Software Development Kit (SDK) for Windows 8" from http://msdn.microsoft.com/en-us/windows/hardware/hh852363.aspx

I was confused by the title - I'm on Windows 7 - but it worked.

Solution pointed by Mark Rainey worked for us: http://www.markrainey.me/2013/02/setting-up-build-machine.html

Changing sdk version

 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 . Changed it to Debug , rebuilt and the build error disappeared.

After 2013 now msbuild is part of VS.

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

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 "

This solution by user489998 worked fine on Windows server 2008 R2 as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM