这个错误消息是什么意思?我能做些什么来纠正这个问题?

AssemblyInfo.cs退出,代码为9009


这个问题可能是在Visual Studio中的. net解决方案的构建后步骤中发生的。


当前回答

Yet another reason: If your pre-build event references another projects bin path and you see this error when running msbuild, but not Visual Studio, then you have to manually arrange the projects in the *.sln file (with a text editor) so that the project you are targeting in the event is built before the event's project. In other words, msbuild uses the order that projects are listed in the *.sln file whereas VS uses knowledge of project dependencies. I had this happen when a tool that creates a database to be included in a wixproj was listed after the wixproj.

其他回答

当我的后构建事件脚本试图运行指定路径中不存在的批处理文件时,我有错误9009。

另外,确保在项目的构建后事件编辑窗口中没有换行符。有时,当xcopy命令是多行时,从web上复制它并粘贴到VS中会导致问题。

Tfa的回答被否决了,但实际上会导致这个问题。 多亏了hanzolo,我在输出窗口中找到了以下内容:

3>'gulp' is not recognized as an internal or external command,
3>operable program or batch file.
3>D:\dev\<filepath>\Web.csproj(4,5): error MSB3073: The command "gulp clean" exited with code 9009.

在运行npm install -g gulp后,我不再得到这个错误。如果在Visual Studio中出现此错误,请检查输出窗口并查看问题是否是未设置的环境变量。

在我的情况下,在调用命令之前,我必须先“CD”(更改目录)到适当的目录,因为我调用的可执行文件在我的项目目录中。

例子:

cd "$(SolutionDir)"
call "$(SolutionDir)build.bat"

我也有类似的问题,我收到了:

命令 ”“C: \ <用户> \用户下载\ XmlDoc2CmdletDoc.0.3.0 \建立. . \ \ sandbox-attacksurface-analysis-tools-c02ed8ba04324e54a0a188ab9877ee6aa372dfac \包工具” C:\Users<user>\Downloads\sandbox-attack - surface-analysis-tools-c02ed8ba04324e54a0a188ab9877ee6aa372dfac\bin\Debug\NtObjectManager.dll" 用代码9009退出。

我当到项目属性>构建和检查XML文档文件:

在那之后,我重建了这个项目,但它消失了。奇怪的是,在我再次选中复选框并重新构建它之后,错误没有返回。 重影故障. .