Welcome to Office Zealot Sign in | Join | Help

Ignoring Visual Basic .NET Compiler Warnings

We have been converting an application developed in VS2003 to VS2005.

One of the new features of VS2005 and VB.NET is that it reports a ton of compiler warnings which is great!

There is one issue we found though. We have a number of CLS non compliant variables. In our case they begin with the underscore character ( _MyVar)

This was done intentionally and we have no plans on changing it. The issue is that there is no mechanism in the VS.NET IDE for ignoring these options. So I dig in a little and spelunked into the Visual Basic Project File and found an entry like this one....

    <NOWARN>42016,42017,42018,42019,42032,40031</NOWARN>

I added the 40031 option (the CLS warnings) and the warnings about non CLS compliant code disappeared.

You need to make sure to add this code to all of the <PROPERTYGROUP>sections.

Published Wednesday, October 05, 2005 1:11 PM by rod

Comments

No Comments

Anonymous comments are disabled