“找不到Al.exe".使用资源文件在MSBuild中构建4.0项目时 [英] "Al.exe could not be found" when build 4.0 projects in MSBuild with resource files

查看:86
本文介绍了“找不到Al.exe".使用资源文件在MSBuild中构建4.0项目时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在4.0框架中开发的项目,与Visual Studio一起运行时可以正常工作.但是,当我在命令提示符下使用MSBuild执行同一项目时,该项目未得到构建,并显示找不到Al.exe"错误.

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"

仅当项目包含资源文件并通过命令提示符使用msbuild进行构建时,才会发生上述问题.

msbuild命令使用以下代码在进程启动方法中运行

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.

此致

阿马尔·拉吉(Amal Raj)

Amal Raj

推荐答案

请确保您对MSBuild的命令行调用使用的版本与Visual Studio版本所使用的生成程序集相同.您没有指定要使用的Visual Studio版本,但是在任何情况下,这都应该为您设定正确的方向:

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. 在Visual Studio中,将以下内容设置为"诊断":工具->选项->项目和解决方案->生成并运行->"MSBuild项目生成输出详细信息".
  2. 生成项目,然后在输出"窗口的生成"窗格中搜索MSBuildToolsPath.
  3. 从命令行构建时,使用该属性的值(例如C:\Program Files (x86)\MSBuild\14.0\bin)作为msbuild.exe的路径.
  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.

编辑 现在我们知道您正在使用VS 2017 RC,并且可以归功于 https://stackoverflow.com/a/40702534/704808,在%programfiles(x86)%\Microsoft Visual Studio\2017\下搜索msbuild.exe.

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\.

这篇关于“找不到Al.exe".使用资源文件在MSBuild中构建4.0项目时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆