Preventing a specific warnig message

When building my project in Visual Studio 2005, I get a tremendous amount of warnings like the following
"warning BC40028: Type of parameter 'form' is not CLS-compliant." .
Also , I have a green undelining in the source editor under the relevant identifier.

I know how to prevent this in command line compilation (/nowarn:)
In the project properties , in the 'Compile' section, there is a list of warning which you can decide whether to show or not, but the above warning is not included.

How do I make these warnings ignored within the VS 2005?
Who is Participating?
DrAskeConnect With a Mentor Commented:
try this :

#pragma warning (C# Reference)

I havn't tried it, but you could add it to the <nowarn> tag in the vbproj file.  My one on a test project currently reads:


Note you'll probably have to change it for all the project configs (eg Debug, Release etc).

Hope this helps


mcoAuthor Commented:
Actually I have tried that but it is not a solution.
It does work by iteself but the next time you change something in the Project properties , your changes are overwritten.
That file is not meant to be edited manually.
mcoAuthor Commented:
Sorry, I have forgotten to mention that the code is written in VB.NET .
The above pragma exists only for C#.
I know this has been closed but for 2008 developers you can open the .vbproj file in notepad and look for an xml tag <NoWarn> there you can list the additional numbers you don't want to see warnings for.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.