Add Manual Error In code & Obsolete a function (Visual Studio C#)

person Jason Huangfolder_openC#, Code, Visual Studiolocal_offer, , access_time September 17, 2009

To add a manual error messag in code to prevent successful compilation of a project.
(You can use it to remind yourself to do something important before you want to compile the whole project or solution.)
(Simply type in code: #Error <message>

#Error : don’t forget to fix the below function before compiling.

#Error : don't forget to fix the below function before compiling.
function myFunction()

You can mark a function obsolete, the compiler would say the function is obsolete during compilation as a reminder. The function can still be used for backward compatibility purpose.

[Obsolete("Use the new MyMethodEx instead!")]
public void MyMethod()


  1. Really enjoy this fabulous site, really good information here, was actually a little bit sceptical with regards to obtaining a steam shower unit for our home having said
    that the info here sorted my head out, fantastic thanks
    for the tips

    My page … luxury steam Showers

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>