MSBuild 命令不会从 Visual Studio 内部运行
我一直在开源 MarkdownDeep 上做了一些修改,但我在发布时遇到了问题out - 该项目包含一个构建后任务,用于使用 Nuget.exe 进行一些打包。
我可以从 dos 框执行该命令,不会出现错误,但该步骤总是失败(当从 VisualStudio 作为发布构建配置的一部分运行时,出现错误:9009。
有人能想到这是为什么吗?
I've been doing a few mods on the open-source MarkdownDeep but I'm having trouble getting a release out - the project includes a post-build task to do some package-ing using Nuget.exe.
I can execute the command without errors from a dos box, but the step always fails (with Error: 9009 when run from VisualStudio as part of a Release build configuration.
Can anyone think why this is?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我猜想,当您从命令行手动运行时,您要么
底线似乎是路径从 Visual Studio 执行时 /s 不起作用(由于断行、
PATH
环境变量中不存在文件等原因,无法找到执行操作所需的目录/文件) )。Visual Studio 中的构建前和构建后步骤“转换”为单个批处理脚本并执行,此步骤中的路径应正确用引号括起来,绝对或相对指定等,但最终需要能够正确扩展/解决完成路径。
例如,我将 引用以下代码片段:
I would guess that when you are running manually from the command line you are either,
The bottom line would seem that the path/s do not work out when executed from Visual Studio (can't find directory / file required to perform an operation, due to line-breakage, file not present in the
PATH
environment variable, and the like).Pre- and post-build steps in Visual Studio get 'converted' into a single batch script and executed, the paths in this step should be properly enclosed in quotes, absolutely or relatively specified etc. but ultimately need to be able to properly expand/resolve to complete paths.
As an example, I'll quote the following snippet: