1

We use TFS 2010 for server builds. I would like to turn some of the less useful warnings off. I can achieve that by specifying custom MSBuild arguments:

/p:NoWarn=1591

It works for a solution with C# projects. However, we have one solution that also has some VB.NET projects in it. VB.NET compiler doesn't have the warnings that C# compiler has, so I get the following error message:

vbc: warning number '1591' for the option 'nowarn' is either not configurable or not valid

Is there a way to achieve this for solution that include projects in several .NET languages without specifying list of ignored warnings separately for every project in the solution?

Dyppl
  • 12,161
  • 9
  • 47
  • 68
  • You should be able to configure this per project, it's not a solution-wide setting, just like you can from the VS IDE itself. Or is this a web site where sources in different languages are part of the same web site? – Abel Apr 06 '12 at 08:21
  • @Abel: I know that I can configure this per project, however, I would like to a) avoid specifying this settings in 30+ projects inside the solution and b) have the ability to only turn them off for server builds – Dyppl Apr 06 '12 at 08:25
  • Check if this is helpful: http://stackoverflow.com/questions/1023858/how-to-suppress-specific-msbuild-warning – pantelif Apr 06 '12 at 10:14

1 Answers1

0

BC* warnings can't be suppressed. Your best option is to reevaluate the NoWarn property in VB projects using the BeforeCompile target, by editing the .vbproj files:

<Target Name="BeforeCompile">
  <PropertyGroup Condition=" '$(NoWarn)' == '1591' ">
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
  </PropertyGroup>
</Target>
KMoraz
  • 14,004
  • 3
  • 49
  • 82