这个错误消息是什么意思?我能做些什么来纠正这个问题?
AssemblyInfo.cs退出,代码为9009
这个问题可能是在Visual Studio中的. net解决方案的构建后步骤中发生的。
这个错误消息是什么意思?我能做些什么来纠正这个问题?
AssemblyInfo.cs退出,代码为9009
这个问题可能是在Visual Studio中的. net解决方案的构建后步骤中发生的。
当前回答
我在编校Path环境变量时导致了此错误。编辑后,我不小心将Path=添加到路径字符串的开头。使用这样一个格式不正确的路径变量,我无法在命令行上运行XCopy(没有找到命令或文件),Visual Studio拒绝运行构建后步骤,并引用代码9009的错误。
XCopy通常位于c:\ windows \ system32。一旦Path环境变量允许XCopy在DOS提示符下得到解析,Visual Studio就很好地构建了我的解决方案。
其他回答
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.
我在预构建步骤的末尾添加了“> myFile.txt”,然后检查文件的实际错误。
错误代码9009表示没有找到错误文件。这里的答案中列出的所有潜在原因都是找出原因的好灵感,但错误本身只是意味着错误的路径。
您是否尝试给出在构建前或构建后事件命令中运行的命令的完整路径?
由于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\
注意,这个关于空格的例子没有经过测试。
我在编校Path环境变量时导致了此错误。编辑后,我不小心将Path=添加到路径字符串的开头。使用这样一个格式不正确的路径变量,我无法在命令行上运行XCopy(没有找到命令或文件),Visual Studio拒绝运行构建后步骤,并引用代码9009的错误。
XCopy通常位于c:\ windows \ system32。一旦Path环境变量允许XCopy在DOS提示符下得到解析,Visual Studio就很好地构建了我的解决方案。