有没有办法让程序检测它是否被 MSBuild 调用?
我正在查看环境,但看不到任何可以使用的东西。有什么想法吗?
我正在尝试针对 Waf 中仅在运行在 MSBuild 下构建(...是的,我知道,这听起来很疯狂,但我们正在使用 MSBuild 驱动我们的 Teamcity 服务器)。
I'm looking in the environment but I can't see anything that I could use. Any ideas?
I'm trying to submit a patch for in Waf a bug that only appears when running the build under MSBuild (...yes I know, it sounds crazy but we're driving our Teamcity server using MSBuild).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
虽然我不能确切地告诉你如何做,但我知道你可以做到。
您应该查看功能来查找父进程,然后查看它的可执行文件名称来确定它是否是 MSBuild.exe。
希望这至少能帮助您指明正确的方向。
Whilst I can't tell you exactly how to do it, I know you can do this.
You should look at functionality to find your parent process and then it's executable name to determine if it's MSBuild.exe or not.
Hope that helps to at least point you in the right direction.
也许这个进程本身可以检查是否有任何 MSBuild.exe 实例正在运行?这可能是一个简单的技巧,尽管它不能回答您的问题。
Maybe this process itself can check if there is any MSBuild.exe instance running? That can be an easy hack, though it does not answer your question.