Pragma to suppress deprecated GetCurrentThreadId

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?S2VuRGV2?=

    Pragma to suppress deprecated GetCurrentThreadId

    I would like to know if there is a pragma id that I can use to suppress the
    warning I get (.NET 2.0) for the GetCurrentThrea dId.

    I want to use warnings as errors and I don't want to change the
    GetCurrentThrea dId as we in the testing stages for our product (I have read a
    few comments about problems just switching to the ManagedThreadId ).

    Does such a pragma id exist, and if so, what is it?

    Thanks,

    ken
  • Jon Skeet [C# MVP]

    #2
    Re: Pragma to suppress deprecated GetCurrentThrea dId

    On Sep 23, 2:42 pm, KenDev <Ken...@discuss ions.microsoft. comwrote:
    I would like to know if there is a pragma id that I can use to suppress the
    warning I get (.NET 2.0)  for the GetCurrentThrea dId.
    >
    I want to use warnings as errors and I don't want to change the
    GetCurrentThrea dId as we in the testing stages for our product (I have read a
    few comments about problems just switching to the ManagedThreadId ).
    >
    Does such a pragma id exist, and if so, what is it?
    Use #pragma warning disable <WARNINGID(an d re-enable it) just round
    the relevant lines of code.

    Jon

    Comment

    • Hans Kesting

      #3
      Re: Pragma to suppress deprecated GetCurrentThrea dId

      KenDev wrote on 23-9-2008 :
      I would like to know if there is a pragma id that I can use to suppress the
      warning I get (.NET 2.0) for the GetCurrentThrea dId.
      >
      I want to use warnings as errors and I don't want to change the
      GetCurrentThrea dId as we in the testing stages for our product (I have read a
      few comments about problems just switching to the ManagedThreadId ).
      >
      Does such a pragma id exist, and if so, what is it?
      >
      Thanks,
      >
      ken
      #pragma warning disable 0618
      // the "obsolete" code that you still want to use
      #pragma warning restore 0618


      The "disable" line disables a specific compiler warning (0618 in this
      case) from this line onward in this file.
      The "restore" line restores normal behaviour from that line on.


      Hans Kesting


      Comment

      • =?Utf-8?B?S2VuRGV2?=

        #4
        RE: Pragma to suppress deprecated GetCurrentThrea dId

        Thanks.

        "KenDev" wrote:
        I would like to know if there is a pragma id that I can use to suppress the
        warning I get (.NET 2.0) for the GetCurrentThrea dId.
        >
        I want to use warnings as errors and I don't want to change the
        GetCurrentThrea dId as we in the testing stages for our product (I have read a
        few comments about problems just switching to the ManagedThreadId ).
        >
        Does such a pragma id exist, and if so, what is it?
        >
        Thanks,
        >
        ken

        Comment

        Working...