是否可以从 csproj 文件中知道是使用 devenv 还是 msbuild 来运行它?
动机: 我在构建过程中集成了 fxcop,这使得每次目标更改时或者只要上次运行 fxcop 出现警告时都会运行 fxcopcmd.exe。
但是当一个人在工作室工作时,devenv.exe 经常会出于某种原因决定在后台编译该项目。 例如,当我向解决方案添加新项目时,我注意到 fxcopcmd.exe 运行,这意味着后台构建已开始。 也有其他时间。
所以,我希望在使用 devenv 构建时抑制 fxcop。 我们的 CI 服务器使用 msbuild 构建,所以没有问题。
顺便说一句,如果有一种方法可以禁用后台构建,那就太好了。
Motivation:
I have fxcop integrated in the build process, which makes fxcopcmd.exe run each time the target has changed or as long as there are warnings from the previous run of fxcop.
But when one works in the studio, devenv.exe often decides to compile the project in background for whatever reasons. For example, when I add a new project to the solution I notice that fxcopcmd.exe runs, meaning a background build has started. There are also other times as well.
So, I wish to suppress fxcop when built with devenv. Our CI server builds using msbuild, so no problem there.
BTW, if there is a way to disable the background builds, that could be great.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有一个属性 BuildingInsideVisualStudio 可以告诉您这一点。
例如,将 msbuild.exe 和 devenv.exe 与 .csproj 一起使用时的结果与定义为
Sayed Ibrahim Hashimi
My Book 的以下 AfterBuild 目标进行比较: Microsoft 构建引擎内部:使用 MSBuild 和 Team Foundation Build
There is a property BuildingInsideVisualStudio which will tell you this.
For example compare the result when using msbuild.exe and devenv.exe with a .csproj with the following AfterBuild target defined
Sayed Ibrahim Hashimi
My Book: Inside the Microsoft Build Engine : Using MSBuild and Team Foundation Build
我唯一能想到的就是
后台编译器是在 VS 2008 中添加到 C# 中的,据我所知,它是不可配置的。 VS 2010 应该是超级可配置的,所以也许这会改变
编辑:格式化我的列表更好一点
The only thing I can think of is to either
The background compiler was added in VS 2008 to C#, and as far as I know, is not configurable. VS 2010 is supposed to be ultra configurable so maybe that will change
Edit: formatted my list a little better