|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
tell if site is a debug build?I am trying to tell if my site is running as a debug build or not in asp.net
1.1 you could say #IF DEBUG DO SOMETHING HERE #ENDIF but in ASP.NET 2.0 it seems not to work anymore... why not?! i have debug="false" in web config and the debug code still runs... On the Visual Studio menu under Build/Configuration change the active
configuration to "Release". The "debug" code will not be included in the resulting executable. Show quoteHide quote "Brian Henry" wrote: > I am trying to tell if my site is running as a debug build or not in asp.net > 1.1 you could say > > #IF DEBUG > DO SOMETHING HERE > #ENDIF > > but in ASP.NET 2.0 it seems not to work anymore... why not?! i have > debug="false" in web config and the debug code still runs... > > > thast what I always did in .NET 1.1 and 1.0 but in 2.0 that doesn't work any
more when you have #if debug directives in it for some reason... my #debug code always runs release or debug build Show quoteHide quote "Brad Roberts" <BradRoberts56noj***@hotmail.com> wrote in message news:4F8D119C-0D93-4AA1-907C-1F03DBD62413@microsoft.com... > On the Visual Studio menu under Build/Configuration change the active > configuration to "Release". The "debug" code will not be included in the > resulting executable. > > "Brian Henry" wrote: > >> I am trying to tell if my site is running as a debug build or not in >> asp.net >> 1.1 you could say >> >> #IF DEBUG >> DO SOMETHING HERE >> #ENDIF >> >> but in ASP.NET 2.0 it seems not to work anymore... why not?! i have >> debug="false" in web config and the debug code still runs... >> >> >> On Tue, 1 Nov 2005 16:51:26 -0500, "Brian Henry" <nospam@nospam.com> Right - those options aren't available in 2.0.wrote: >thast what I always did in .NET 1.1 and 1.0 but in 2.0 that doesn't work any >more when you have #if debug directives in it for some reason... my #debug >code always runs release or debug build > Are you using a filed based web site or one in IIS? I can see my code not executing inside #if DEBUG if I turn debugging off and run with CTRL-F5. Perhaps you could clean out the Temporary ASP.NET files directory and see what happens. I'm having the same problem. Using the compiler directive #IF DEBUG
around my code, works when debugging, but when I set the <compilation defaultLanguage="c#" debug="false"> in web.config for release build, the debug statements still run, ie the DEBUG constant is still set to true. Any thoughts or alternative solutions anyone? Scott Allen wrote: Show quoteHide quote > On Tue, 1 Nov 2005 16:51:26 -0500, "Brian Henry" <nospam@nospam.com> > wrote: > > >thast what I always did in .NET 1.1 and 1.0 but in 2.0 that doesn't work any > >more when you have #if debug directives in it for some reason... my #debug > >code always runs release or debug build > > > > Right - those options aren't available in 2.0. > > Are you using a filed based web site or one in IIS? I can see my code > not executing inside #if DEBUG if I turn debugging off and run with > CTRL-F5. Perhaps you could clean out the Temporary ASP.NET files > directory and see what happens. > > -- > Scott > http://www.OdeToCode.com/blogs/scott/ Where do you have this #if test (in ASPX markup or in a code behing file) ?
My first thought would be that you disabled debug for ASPX pages but that you still have in /bin a code behind DLL compiled in Debug mode... Is this 1.1 or 2.0 ? Which compilation model are you using ? --- Patrice <r**@stringx.com> a écrit dans le message de Show quoteHide quote news:1132050417.061177.124660@g49g2000cwa.googlegroups.com... > I'm having the same problem. Using the compiler directive #IF DEBUG > around my code, works when debugging, but when I set the > > <compilation defaultLanguage="c#" debug="false"> > > in web.config for release build, the debug statements still run, ie the > DEBUG constant is still set to true. > > Any thoughts or alternative solutions anyone? > > Scott Allen wrote: > > On Tue, 1 Nov 2005 16:51:26 -0500, "Brian Henry" <nospam@nospam.com> > > wrote: > > > > >thast what I always did in .NET 1.1 and 1.0 but in 2.0 that doesn't work any > > >more when you have #if debug directives in it for some reason... my #debug > > >code always runs release or debug build > > > > > > > Right - those options aren't available in 2.0. > > > > Are you using a filed based web site or one in IIS? I can see my code > > not executing inside #if DEBUG if I turn debugging off and run with > > CTRL-F5. Perhaps you could clean out the Temporary ASP.NET files > > directory and see what happens. > > > > -- > > Scott > > http://www.OdeToCode.com/blogs/scott/ > Here is some more information:
http://odetocode.com/Blogs/scott/archive/2005/11/15/2464.aspx Show quoteHide quote On Tue, 1 Nov 2005 15:24:01 -0500, "Brian Henry" <nospam@nospam.com> wrote: >I am trying to tell if my site is running as a debug build or not in asp.net >1.1 you could say > >#IF DEBUG > DO SOMETHING HERE >#ENDIF > >but in ASP.NET 2.0 it seems not to work anymore... why not?! i have >debug="false" in web config and the debug code still runs... >
Other interesting topics
Threads sharing objects in memory during high volume use
How can I stop ASPX file rendering in Page_Load event? server.transfer Making an Excel File unselectable datacombo Code reuse, code behind, and can't inherit since already inherits Page Finding a control VS2005 - unable to create a website in IIS strange string added to all project's URLs when running on localhost progrss bar that shows that status of processes |
|||||||||||||||||||||||