doubt

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Baskar RajaSekharan

    doubt

    In C-sharp, I wnat to know whether the Component is compiled in Debug Mode
    or Run Mode through Code. How is it possible?
    Is there any way to Access the Config file and check? Please let me know
    with example


  • Muscha

    #2
    Checking compile mode (Was: doubt)

    The Debug/Release mode is just a name, you can call them Jon/Bob it doesn
    matter. What matter is the configuration underneath it. Check the
    configuration manager to find out.

    To answer your question, yes you can by default if you didn't change any the
    configuration settings. Example:

    #if (DEBUG)
    Console.WriteLi ne("Debug mode");
    #elif (TRACE)
    Console.WriteLi ne("Release mode");
    #endif


    HTH,
    /m

    PS: please start a new thread and change the subject line! It's really
    annoying.

    "Baskar RajaSekharan" <rbk@srasys.co. in> wrote in message
    news:%23BDeQ92o DHA.1084@tk2msf tngp13.phx.gbl. ..[color=blue]
    > In C-sharp, I wnat to know whether the Component is compiled in Debug[/color]
    Mode[color=blue]
    > or Run Mode through Code. How is it possible?
    > Is there any way to Access the Config file and check? Please let me know
    > with example
    >
    >[/color]


    Comment

    • Baskar RajaSekharan

      #3
      Re: Checking compile mode (Was: doubt)

      Thank you for your reply. How to check the Configuration Manager through
      code and findout it's debug or Release. Can you give
      me some sample code?

      "Muscha" <muscha@no.spam .net> wrote in message
      news:Oe2FuG3oDH A.2232@TK2MSFTN GP09.phx.gbl...[color=blue]
      > The Debug/Release mode is just a name, you can call them Jon/Bob it doesn
      > matter. What matter is the configuration underneath it. Check the
      > configuration manager to find out.
      >
      > To answer your question, yes you can by default if you didn't change any[/color]
      the[color=blue]
      > configuration settings. Example:
      >
      > #if (DEBUG)
      > Console.WriteLi ne("Debug mode");
      > #elif (TRACE)
      > Console.WriteLi ne("Release mode");
      > #endif
      >
      >
      > HTH,
      > /m
      >
      > PS: please start a new thread and change the subject line! It's really
      > annoying.
      >
      > "Baskar RajaSekharan" <rbk@srasys.co. in> wrote in message
      > news:%23BDeQ92o DHA.1084@tk2msf tngp13.phx.gbl. ..[color=green]
      > > In C-sharp, I wnat to know whether the Component is compiled in Debug[/color]
      > Mode[color=green]
      > > or Run Mode through Code. How is it possible?
      > > Is there any way to Access the Config file and check? Please let me[/color][/color]
      know[color=blue][color=green]
      > > with example
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Muscha

        #4
        Re: Checking compile mode (Was: doubt)

        > Thank you for your reply. How to check the Configuration Manager through[color=blue]
        > code and findout it's debug or Release. Can you give
        > me some sample code?[/color]

        #if (DEBUG)
        Console.WriteLi ne("Debug mode");
        #elif (TRACE)
        Console.WriteLi ne("Release mode");
        #endif

        Configuration Manager -> Open Visual Studio, right click on the project
        file, Properties.

        /m


        [color=blue]
        >
        > "Muscha" <muscha@no.spam .net> wrote in message
        > news:Oe2FuG3oDH A.2232@TK2MSFTN GP09.phx.gbl...[color=green]
        > > The Debug/Release mode is just a name, you can call them Jon/Bob it[/color][/color]
        doesn[color=blue][color=green]
        > > matter. What matter is the configuration underneath it. Check the
        > > configuration manager to find out.
        > >
        > > To answer your question, yes you can by default if you didn't change any[/color]
        > the[color=green]
        > > configuration settings. Example:
        > >
        > > #if (DEBUG)
        > > Console.WriteLi ne("Debug mode");
        > > #elif (TRACE)
        > > Console.WriteLi ne("Release mode");
        > > #endif
        > >
        > >
        > > HTH,
        > > /m
        > >
        > > PS: please start a new thread and change the subject line! It's really
        > > annoying.
        > >
        > > "Baskar RajaSekharan" <rbk@srasys.co. in> wrote in message
        > > news:%23BDeQ92o DHA.1084@tk2msf tngp13.phx.gbl. ..[color=darkred]
        > > > In C-sharp, I wnat to know whether the Component is compiled in[/color][/color][/color]
        Debug[color=blue][color=green]
        > > Mode[color=darkred]
        > > > or Run Mode through Code. How is it possible?
        > > > Is there any way to Access the Config file and check? Please let me[/color][/color]
        > know[color=green][color=darkred]
        > > > with example
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • Baskar RajaSekharan

          #5
          Re: Checking compile mode (Was: doubt)

          How to do that in Run Time? I hope you are not properly understand My
          Qustion. If repeat the Qustion.

          In C-Sharp I create two Component and compiled one in Release Mode and
          another one is in compile Mode. Assume that the two components are

          A.dll = Debug Mode

          B.dll = RelatesMode

          I want to write one method which will accept the dll path as a input and
          return it's compiled in Debug mode or release mode. based on the Result i am
          going to do some operations.

          How the above one is possible. Can you give me some sample code.

          Regards,
          R.Baskar

          "Muscha" <muscha@no.spam .net> wrote in message
          news:uv6UaZ3oDH A.1084@tk2msftn gp13.phx.gbl...[color=blue][color=green]
          > > Thank you for your reply. How to check the Configuration Manager[/color][/color]
          through[color=blue][color=green]
          > > code and findout it's debug or Release. Can you give
          > > me some sample code?[/color]
          >
          > #if (DEBUG)
          > Console.WriteLi ne("Debug mode");
          > #elif (TRACE)
          > Console.WriteLi ne("Release mode");
          > #endif
          >
          > Configuration Manager -> Open Visual Studio, right click on the project
          > file, Properties.
          >
          > /m
          >
          >
          >[color=green]
          > >
          > > "Muscha" <muscha@no.spam .net> wrote in message
          > > news:Oe2FuG3oDH A.2232@TK2MSFTN GP09.phx.gbl...[color=darkred]
          > > > The Debug/Release mode is just a name, you can call them Jon/Bob it[/color][/color]
          > doesn[color=green][color=darkred]
          > > > matter. What matter is the configuration underneath it. Check the
          > > > configuration manager to find out.
          > > >
          > > > To answer your question, yes you can by default if you didn't change[/color][/color][/color]
          any[color=blue][color=green]
          > > the[color=darkred]
          > > > configuration settings. Example:
          > > >
          > > > #if (DEBUG)
          > > > Console.WriteLi ne("Debug mode");
          > > > #elif (TRACE)
          > > > Console.WriteLi ne("Release mode");
          > > > #endif
          > > >
          > > >
          > > > HTH,
          > > > /m
          > > >
          > > > PS: please start a new thread and change the subject line! It's really
          > > > annoying.
          > > >
          > > > "Baskar RajaSekharan" <rbk@srasys.co. in> wrote in message
          > > > news:%23BDeQ92o DHA.1084@tk2msf tngp13.phx.gbl. ..
          > > > > In C-sharp, I wnat to know whether the Component is compiled in[/color][/color]
          > Debug[color=green][color=darkred]
          > > > Mode
          > > > > or Run Mode through Code. How is it possible?
          > > > > Is there any way to Access the Config file and check? Please let[/color][/color][/color]
          me[color=blue][color=green]
          > > know[color=darkred]
          > > > > with example
          > > > >
          > > > >
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Muscha

            #6
            Re: Checking compile mode (Was: doubt)

            I see, now I get your question.

            In that case I am not sure about how that can be done. Maybe someone else
            can shed some light? Compiling a compoenent in debug or release mode will
            put a TRACE/DEBUG in the /define command line parameter to the compiler.

            Maybe if you look at this it may give you some information.

            /m


            "Baskar RajaSekharan" <rbk@srasys.co. in> wrote in message
            news:uMBKur3oDH A.3732@tk2msftn gp13.phx.gbl...[color=blue]
            > How to do that in Run Time? I hope you are not properly understand My
            > Qustion. If repeat the Qustion.
            >
            > In C-Sharp I create two Component and compiled one in Release Mode and
            > another one is in compile Mode. Assume that the two components are
            >
            > A.dll = Debug Mode
            >
            > B.dll = RelatesMode
            >
            > I want to write one method which will accept the dll path as a input and
            > return it's compiled in Debug mode or release mode. based on the Result i[/color]
            am[color=blue]
            > going to do some operations.
            >
            > How the above one is possible. Can you give me some sample code.
            >
            > Regards,
            > R.Baskar
            >
            > "Muscha" <muscha@no.spam .net> wrote in message
            > news:uv6UaZ3oDH A.1084@tk2msftn gp13.phx.gbl...[color=green][color=darkred]
            > > > Thank you for your reply. How to check the Configuration Manager[/color][/color]
            > through[color=green][color=darkred]
            > > > code and findout it's debug or Release. Can you give
            > > > me some sample code?[/color]
            > >
            > > #if (DEBUG)
            > > Console.WriteLi ne("Debug mode");
            > > #elif (TRACE)
            > > Console.WriteLi ne("Release mode");
            > > #endif
            > >
            > > Configuration Manager -> Open Visual Studio, right click on the project
            > > file, Properties.
            > >
            > > /m
            > >
            > >
            > >[color=darkred]
            > > >
            > > > "Muscha" <muscha@no.spam .net> wrote in message
            > > > news:Oe2FuG3oDH A.2232@TK2MSFTN GP09.phx.gbl...
            > > > > The Debug/Release mode is just a name, you can call them Jon/Bob it[/color]
            > > doesn[color=darkred]
            > > > > matter. What matter is the configuration underneath it. Check the
            > > > > configuration manager to find out.
            > > > >
            > > > > To answer your question, yes you can by default if you didn't change[/color][/color]
            > any[color=green][color=darkred]
            > > > the
            > > > > configuration settings. Example:
            > > > >
            > > > > #if (DEBUG)
            > > > > Console.WriteLi ne("Debug mode");
            > > > > #elif (TRACE)
            > > > > Console.WriteLi ne("Release mode");
            > > > > #endif
            > > > >
            > > > >
            > > > > HTH,
            > > > > /m
            > > > >
            > > > > PS: please start a new thread and change the subject line! It's[/color][/color][/color]
            really[color=blue][color=green][color=darkred]
            > > > > annoying.
            > > > >
            > > > > "Baskar RajaSekharan" <rbk@srasys.co. in> wrote in message
            > > > > news:%23BDeQ92o DHA.1084@tk2msf tngp13.phx.gbl. ..
            > > > > > In C-sharp, I wnat to know whether the Component is compiled in[/color]
            > > Debug[color=darkred]
            > > > > Mode
            > > > > > or Run Mode through Code. How is it possible?
            > > > > > Is there any way to Access the Config file and check? Please let[/color][/color]
            > me[color=green][color=darkred]
            > > > know
            > > > > > with example
            > > > > >
            > > > > >
            > > > >
            > > > >
            > > >
            > > >[/color]
            > >
            > >[/color]
            >
            >[/color]


            Comment

            • Rakesh Namineni[MSFT]

              #7
              Re: Checking compile mode (Was: doubt)

              If you are writing some non-shipping app and doing this as part of some
              internal work then try this...

              With CLR 1.0, the debug assemblies have a custom attribute
              System.Diagnost ics.DebuggableA ttribute. The release assemblies do not have
              this attribute. The attribute is a runtime JIT directive. This is a very
              unreliable solution because some body writing a release dll could put this
              attribute on the assembly as well. The attribute is added to the debug
              assembly only if the assembly was built with some compiler options. And
              that is why I insist that you wouldn't want to ship your work with this
              solution.
              If you have a later version of the CLR then find where ildasm.exe is on
              your machine. Run it on the dll. Look at the assembly manifest of a debug
              and release dlls. See what you find different. The new versions have
              replaced the System.Diagnosi tics.Debuggable with
              System.Runtime. CompilerService s.
              Again, I repeat, this is not a solid solution. But if you are working on
              some internal tool and need a quick and dirty solution it might help.



              --------------------[color=blue]
              >Reply-To: "Baskar RajaSekharan" <rbk@srasys.co. in>
              >From: "Baskar RajaSekharan" <rbk@srasys.co. in>
              >References: <#BDeQ92oDHA.10 84@tk2msftngp13 .phx.gbl>[/color]
              <Oe2FuG3oDHA.22 32@TK2MSFTNGP09 .phx.gbl>
              <uxskGS3oDHA.22 68@TK2MSFTNGP12 .phx.gbl>
              <uv6UaZ3oDHA.10 84@tk2msftngp13 .phx.gbl>[color=blue]
              >Subject: Re: Checking compile mode (Was: doubt)
              >Date: Wed, 5 Nov 2003 14:30:39 +0530
              >Lines: 85
              >Organization : SRA System Ltd
              >X-Priority: 3
              >X-MSMail-Priority: Normal
              >X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
              >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
              >Message-ID: <uMBKur3oDHA.37 32@tk2msftngp13 .phx.gbl>
              >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
              >NNTP-Posting-Host: 203.199.194.34
              >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!tk2 msftngp13.phx.g bl
              >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1968 47
              >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
              >
              >How to do that in Run Time? I hope you are not properly understand My
              >Qustion. If repeat the Qustion.
              >
              >In C-Sharp I create two Component and compiled one in Release Mode and
              >another one is in compile Mode. Assume that the two components are
              >
              >A.dll = Debug Mode
              >
              >B.dll = RelatesMode
              >
              >I want to write one method which will accept the dll path as a input and
              >return it's compiled in Debug mode or release mode. based on the Result i[/color]
              am[color=blue]
              >going to do some operations.
              >
              > How the above one is possible. Can you give me some sample code.
              >
              >Regards,
              >R.Baskar
              >
              >"Muscha" <muscha@no.spam .net> wrote in message
              >news:uv6UaZ3oD HA.1084@tk2msft ngp13.phx.gbl.. .[color=green][color=darkred]
              >> > Thank you for your reply. How to check the Configuration Manager[/color][/color]
              >through[color=green][color=darkred]
              >> > code and findout it's debug or Release. Can you give
              >> > me some sample code?[/color]
              >>
              >> #if (DEBUG)
              >> Console.WriteLi ne("Debug mode");
              >> #elif (TRACE)
              >> Console.WriteLi ne("Release mode");
              >> #endif
              >>
              >> Configuration Manager -> Open Visual Studio, right click on the project
              >> file, Properties.
              >>
              >> /m
              >>
              >>
              >>[color=darkred]
              >> >
              >> > "Muscha" <muscha@no.spam .net> wrote in message
              >> > news:Oe2FuG3oDH A.2232@TK2MSFTN GP09.phx.gbl...
              >> > > The Debug/Release mode is just a name, you can call them Jon/Bob it[/color]
              >> doesn[color=darkred]
              >> > > matter. What matter is the configuration underneath it. Check the
              >> > > configuration manager to find out.
              >> > >
              >> > > To answer your question, yes you can by default if you didn't change[/color][/color]
              >any[color=green][color=darkred]
              >> > the
              >> > > configuration settings. Example:
              >> > >
              >> > > #if (DEBUG)
              >> > > Console.WriteLi ne("Debug mode");
              >> > > #elif (TRACE)
              >> > > Console.WriteLi ne("Release mode");
              >> > > #endif
              >> > >
              >> > >
              >> > > HTH,
              >> > > /m
              >> > >
              >> > > PS: please start a new thread and change the subject line! It's[/color][/color][/color]
              really[color=blue][color=green][color=darkred]
              >> > > annoying.
              >> > >
              >> > > "Baskar RajaSekharan" <rbk@srasys.co. in> wrote in message
              >> > > news:%23BDeQ92o DHA.1084@tk2msf tngp13.phx.gbl. ..
              >> > > > In C-sharp, I wnat to know whether the Component is compiled in[/color]
              >> Debug[color=darkred]
              >> > > Mode
              >> > > > or Run Mode through Code. How is it possible?
              >> > > > Is there any way to Access the Config file and check? Please let[/color][/color]
              >me[color=green][color=darkred]
              >> > know
              >> > > > with example
              >> > > >
              >> > > >
              >> > >
              >> > >
              >> >
              >> >[/color]
              >>
              >>[/color]
              >
              >
              >[/color]


              Rakesh, EFT.

              This posting is provided "AS IS" with no warranties, and confers no rights.
              Use of included script samples are subject to the terms specified at
              Use these online forms to report copyright and trademark infringement to Microsoft Legal. Infringement notices must comply with the Digital Millennium Copyright Act.


              Comment

              Working...