Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7975479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:39:05+00:00 2026-06-04T08:39:05+00:00

I am using the Microsoft TFS API and one of the properties on one

  • 0

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.

I have tried doing this:

#pragma warning disable 0612, 0618
            request.CommandLineArguments = arguments;
#pragma warning restore 0612, 0618

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

EDIT

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

enter image description here

EDIT 2:

After using ILSpy the CommandLineArguments property looks like this in the TFS2010 API:

    [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;
    }

Unfortunately I don’t think there is a way to tell the compiler to ignore the error that the Obsolete attribute is causing.

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T08:39:06+00:00Added an answer on June 4, 2026 at 8:39 am

    Following works for me:

    #pragma warning disable 612,618
                request.CommandLineArguments = arguments;
    #pragma warning restore 612,618
    

    notice no leading 0 in the numbers

    EDIT:
    Okay, your assembly has the “true” argument in the ObsoleteAttribute constructor. This means you can’t use the property and not get an error.

    If you can’t re-write your code to avoid using this property, you’ll have to invoke the property setter via reflection, for example:

    request.GetType().GetProperty("Number").SetValue(request, arguments, null);
    

    and getting is similar:

    (string)request.GetType().GetProperty(“CommandLineArguments”).GetValue(request, null);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been using Microsoft.Jet.OLEDB.4.0 and Microsoft.ACE.OLEDB.12.0 to read in .csv, .xls, and .xlsx files.
I am using Microsoft SQL Server. I have a Table which had been updated
Is there a way using TFS (Microsoft Team Foundation Server) to configure a folder
There are tons of great examples of creating work items using the TFS API,
We are using VS 2010 and TFS 2010 with the Microsoft Scrum Template .
I have found several samples about retrieving test results using the TFS API, but
I have been using Selenium (WebDriver) for some time now, utilising Microsoft Team Foundation
Using: Microsoft SQL Server 2008 Microsoft Visual Studio 2010 C# .NET 4.0 WinForms Ok
using Microsoft.SqlServer.Management.SqlStudio.Explorer; unable to find this pls assist [update] found the dll's in this
Using Microsoft Visual Studio 2010: Can I write this type of macro in C?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.