Turn off compiler warnings in some specific spots in the code

M

Maxwell2006

Hi,

How can I turn off the compiler warnings in some specific spots in the code?

I don't want to turn off warnings for all project. I remember we had PRAGMA
feature in C++. Do we have the similar thing in C#?

Thank you,
Max
 
W

Willy Denoyette [MVP]

| Hi,
|
| How can I turn off the compiler warnings in some specific spots in the
code?
|
| I don't want to turn off warnings for all project. I remember we had
PRAGMA
| feature in C++. Do we have the similar thing in C#?
|
| Thank you,
| Max
|
|

C# v2 has it, check the C# programmer's reference

#pragma warning disable 3021, 1023
....
#pragma warning restore 3021

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top