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

AssemblyInfo.cs退出,代码为9009


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


当前回答

这是非常基本的,我遇到过这样的问题,而且是令人尴尬的简单失败。

应用程序使用命令行参数,我删除了它们,然后将它们添加回来。突然,这个项目没能建成。

Visual Studio ->项目属性->验证您使用的是“调试”选项卡(而不是“生成事件”选项卡)->命令行参数

我使用了和Post/Pre-build文本区域,这在这种情况下是错误的。

其他回答

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.

您是否尝试给出在构建前或构建后事件命令中运行的命令的完整路径?

由于Visual Studio 2008中的xcopy post-build事件命令,我得到了9009错误。

命令“xcopy.exe /Y C:\projectpath\project. exe”config C:\compilepath\"退出代码为9009。

但我的情况是间歇性的。也就是说,错误消息一直持续到计算机重新启动,并在计算机重新启动后消失。在一些我尚未发现的远程相关问题之后,它又回来了。

然而,在我的情况下,提供命令的完整路径解决了问题:

c:\windows\system32\xcopy.exe /Y C:\projectpath\project.config C:\compilepath\ 

而不仅仅是:

xcopy.exe /Y C:\projectpath\project.config C:\compilepath\

如果我没有完整的路径,它会在重新启动后运行一段时间,然后停止。

另外,正如本文评论中提到的,如果全路径中有空格,则需要在命令周围加上引号。如。

"C:\The folder with spaces\ABCDEF\xcopy.exe" /Y C:\projectpath\project.config C:\compilepath\

注意,这个关于空格的例子没有经过测试。

您需要确保已全局安装了grunt

如果脚本确实做了它需要做的事情,而Visual Studio只是因为错误而困扰你,你可以添加:

exit 0

到你剧本的结尾。

我有同样的错误导致我的后构建脚本,我试图在命令提示符中逐行运行脚本。最后我发现根本原因是我没有填充.nuspec文件中缺失的信息,即将$和$之间的所有变量替换为实际值,例如将$author$替换为我的名字