读取/捕获 DOS 输入以在 MsBuild 中使用
如何捕获/读取 DOS 输入以在 MsBuild 中使用?
编辑澄清
目前我有 2 个文件。一个批处理文件,另一个是 core.msbuild 文件,其中包含 msbuild 内容。我希望能够从 Windows 命令提示符(执行构建文件时)捕获额外的用户输入,例如输出目录,并将其发送到 msbuild 文件(并将其设置为 PropertyGroup)。 %1 已被占用,因此我正在考虑使用 %2。
如下所示:
build.bat param1 param2
param2 是我试图捕获并执行上述操作的参数。
谢谢。
How do I capture/read DOS input for use in MsBuild?
EDITED for clarification
Currently I have 2 files. One batch file, the other is the core.msbuild file which contains the msbuild stuff. I want to be able to capture an extra user input e.g. an output directory, from the windows command prompt (when the build file is executed) and send it to the msbuild file (and set it to a PropertyGroup). %1 is already taken so I'm thinking to use %2.
Like the following:
build.bat param1 param2
param2 is the one im trying to capture and do the above.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
明白了...
在 build.bat 文件中,将其附加到构建字符串:
在 MsBuild 文件中:
然后可以在 Targets 中使用 OutputDir。
谢谢。
Got it...
In the build.bat file, append this to a build string:
In MsBuild file:
Then OutputDir can be used in Targets.
Thanks.
自动化构建的理念不就是构建是可重复的并且无需用户输入吗?
但是,我猜想 powershell 有一些比标准 dos 更好的选项来获取用户的输入。
Isn't the idea of an automated build that the build is repeateable and without user input?
But, i would guess that powershell has some better options for getting input from a user for this than standard dos.
是否也可以在执行构建文件之前查询用户输入并将其作为参数传递?
Would it also be possible to query the user input before executing the build file and pass it as a param?