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

AssemblyInfo.cs退出,代码为9009


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


当前回答

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

其他回答

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

exit 0

到你剧本的结尾。

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

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

仔细检查Output选项卡。

这应该能揭示问题的原因。

(例如,在我的例子中,它与注释有关:'#'不能被识别为内部或外部命令,可操作的程序或批处理文件。)