1
votes

I have a project developed in 4.0 framework and it is working fine when running with visual studio. But when i execute the same project with MSBuild in command prompt , the project not getting build which shows error of "Al.exe is not found"

"C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Msbuild.exe"

The above issue occurs only if the project contains resource files and build with msbuild through command prompt.

The msbuild command runs through process start methods using the below code,

ProcessStartInfo psi = new ProcessStartInfo();

psi.FileName = "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Msbuild.exe";

psi.Arguments = "D:\Samples\Localization\cs\LocalizationDemo_2010.csproj" /p:Configuration=Release /nologo /noconlog /fileLogger /fileloggerparameters:logfile="D:\Samples\Localization\cs\build.log";

Process p = Process.Start(psi);

Please anyone help me if you have any ideas about this.

Regards,

Amal Raj

1
Show the entire error message pleaseOfir Winegarten
@OfirW error MSB3086: 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 installedAmal
Did you install the Windows SDK ? microsoft.com/downloads/…Ofir Winegarten
i have installed all .net frame work versions upto 4.6 . i could not find windows sdk for windows 7 and 4.0Amal
Here's a stupid tip: I had the exact same issue, but with .NET 2.0 projects. I was missing the Individual Component ".NET Framework 3.5 development tools" in the VS setup. Installing them fixed it.Ray

1 Answers

2
votes

Ensure that your command line invocation of MSBuild uses the same set of build assemblies that your version of Visual Studio uses. You did not specify what version of Visual Studio you are using, but in any case this should set you in the right direction:

  1. In Visual Studio, set the following to Diagnostic: Tools->Options->Projects and Solutions->Build and Run->"MSBuild project build output verbosity".
  2. Build the project and then search the Output window's Build pane for MSBuildToolsPath.
  3. Use that property's value (e.g. C:\Program Files (x86)\MSBuild\14.0\bin) as the path to msbuild.exe when you build from the command line.

EDIT Now that we know you are using VS 2017 RC, and with credit to https://stackoverflow.com/a/40702534/704808, search for msbuild.exe under %programfiles(x86)%\Microsoft Visual Studio\2017\.