Disabling OBSOLETE error in C#
<p>I am using the Microsoft TFS API and one of the properties on one of the interfaces has been marked as Obsolete and it instructs me to use a different property.  Unfortunately the property the API wants me to use is used by TFS2010 and not TFS2008.</p>

<p>I have tried doing this:</p>

<pre><code>#pragma warning disable 0612, 0618
            request.CommandLineArguments = arguments;
#pragma warning restore 0612, 0618
</code></pre>

<p>But I still get the error that CommandLineArguments is obsolete.  Is there anyway to suppress this?</p>

<p>EDIT</p>

<p>Unfortunately this is not showing up as a 'Warning as Error', in fact Treat Warning's As Error's is turned off in my project.  Here is a screen cap of the offending code as well as the error list</p>

<p><img src="http://i.stack.imgur.com/ybJ4k.png" alt="enter image description here"></p>

<p>EDIT 2:</p>

<p>After using ILSpy the CommandLineArguments property looks like this in the TFS2010 API:</p>

<pre><code>    [Obsolete("This property has been deprecated. Please remove all references. To pass command line arguments to MSBuild.exe, set the ProcessParameters property.", true)]
    string CommandLineArguments
    {
        get;
        set;
    }
</code></pre>

<p>Unfortunately I don't think there is a way to tell the compiler to ignore the error that the Obsolete attribute is causing.  </p>

<p>EDIT 3
As @Peter Ritchie points out this value could be set via reflection. As I thought through this problem though my guess is that if Microsoft set the property to throw an exception even if you did set it via reflection I doubt that the value would be referenced anywhere. </p>
