Re: Are compiler #Pragma equivalents supported in C#?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Nicholas Paldino [.NET/C# MVP] (mvp_at_spam.guard.caspershouse.com)
Date: 06/14/04


Date: Mon, 14 Jun 2004 14:04:15 -0400

Gary,

    Pragma statements are not part of the C# language. However, you can
suppress the warning options through the /nowarn flag (if using CSC on the
command line). This allows you to specify which warnings to not have
appear.

    Also, you can set the properties on the project to ignore these
warnings, by going to the properties for the project, and then going to
"Configuration Properties | Build". There is a property "Suppress Specific
Warnings" which you want to set to the warnings you want to suppress.

    Hope this helps.

-- 
               - Nicholas Paldino [.NET/C# MVP]
               - mvp@spam.guard.caspershouse.com
"Gary James" <garyj@iotech.com> wrote in message
news:OuQklhjUEHA.1012@TK2MSFTNGP09.phx.gbl...
> I'm looking for a way to suppress the CS0659 compiler warning message
about
> class overrides Equals but does not provide a GetHashCode() override.   In
> C++ VS allows this through the use of the #Pragma statement.  Does VS.NET
> have the equivalent?
>
> Gary ...
>


Relevant Pages

  • Re: How do I suppress warnings when using an Access MDB as a runti
    ... between the registry edit for the security key and a little added VB ... function to suppress the warnings, ...
    (microsoft.public.access.security)
  • Re: How do I suppress warnings when using an Access MDB as a runti
    ... > function to suppress the warnings, ... And you added a public VBA function to turn the warnings back on, ... >> The destination computer can have the macro security settings set to Low ...
    (microsoft.public.access.security)
  • Re: Link Warnings
    ... Used LDEFINES=$/IGNORE:4210 in appropriate SOURCES file, ... gets rid of 4210 warnings and others but will not suppress 4099. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: RFC: Google Groups grabber in Perl
    ... No warnings? ... No way to allow the user to specify a different URL ...
    (comp.lang.perl.misc)
  • Re: gcc-3.3 issues
    ... to see the condition Alexander speaks of. ... > Doesn't that mean, if you don't specify any pedantic, it defaults ... Specifying -pedantic doesn't turn errors into warnings for ... downgrades many errors into warnings. ...
    (freebsd-current)