如何修复 C# Express 构建前/构建后事件?
我有 2 台机器,上面装有 C# Express 版本。
一方面,我可以构建我的解决方案,并且我的构建事件可以完美执行。另一方面,无论投入什么,它总是会失败。构建输出具有“C:\Documents in not a valid path”或类似的内容,并指向 Microsoft.Common.targets 中包含 ExecworkingDirectory="$(OutDir)" 的行,无论它是前置还是后置构建事件。我已经删除了目标文件以及一些 MSBuild 文件,然后修复了 .Net,希望能够解决问题,但没有成功。
关于下一步该做什么有什么建议吗?
编辑:这是我收到的错误。
“E:\Programs\Visual Studio 2008\Projects\Work\Brandcode Manager....\Tools\Versioner.exe”“E:\Programs\Visual Studio 2008\Projects\C_Sharp\kjCommonFunctions\kjCommonFunctions\Properties\AssemblyInfo.cs “
‘C:\Documents’不被识别为内部或外部命令, 可运行的程序或批处理文件。 系统找不到指定的路径。
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(895,9):错误 MSB3073:命令“”E:\Programs\Visual Studio 2008\Projects\Work\Brandcode Manager.. ..\Tools\Versioner.exe" "E:\Programs\Visual Studio 2008\Projects\C_Sharp\kjCommonFunctions\kjCommonFunctions\Properties\AssemblyInfo.cs"" 退出,代码为 1。
I have 2 machines that have the Express version of C# on them.
On one, I can build my solution and my build events execute perfectly. On the other, no matter what is put in the event it always fails. The build output has "C:\Documents in not a valid path" or something to that effect, and points to the line in Microsoft.Common.targets that contains Exec WorkingDirectory="$(OutDir)" whether it is a pre or post build event. I have deleted the targets file along with some of the MSBuild files and then repaired .Net hoping that would fix the problem, but no luck.
Any suggestions on what to do next?
Edit: This is the error that I am getting.
"E:\Programs\Visual Studio 2008\Projects\Work\Brandcode Manager....\Tools\Versioner.exe" "E:\Programs\Visual Studio 2008\Projects\C_Sharp\kjCommonFunctions\kjCommonFunctions\Properties\AssemblyInfo.cs"
'C:\Documents' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(895,9): error MSB3073: The command ""E:\Programs\Visual Studio 2008\Projects\Work\Brandcode Manager....\Tools\Versioner.exe" "E:\Programs\Visual Studio 2008\Projects\C_Sharp\kjCommonFunctions\kjCommonFunctions\Properties\AssemblyInfo.cs"" exited with code 1.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据猜测,我会说它在某处缺少引号 - 即名称中带有空格的文件夹,假设实际路径位于
C:\Documents and Settings\...
但需要查看真实的路径构建输出和解决方案文件的路径以给出明确的答案At a guess I would say it is missing quotes somewhere - ie folders with spaces in the name, assuming the actual path is in
C:\Documents and Settings\...
but would need to see the real build output and the path of your solution file to give a definative answer这就是我最终弄清楚的。
我所使用的计算机的自动登录帐户的用户名(我们共享笔记本电脑的通用登录)包含一个与号(&)。我认为这可能是造成问题的原因。当我在那台笔记本电脑上创建另一个帐户,然后从那里编译我的 pre 和 .构建后事件有效。
凯杰
Here's what I ended up figuring out.
The username for the autologon account for the computer I was using (generic logon for our shared laptops) included an ampersand (&). I think that may have been causing the problems. When I created another account on that laptop and then compiled from there both my pre & post-build events worked.
KJ