I have a ASP.Net 2.0 web application that I am trying to debug. Problem is
that I can't get the error message to show in the browser. It always returns
the generic error message telling me to set customErrors="Off". Problem is I
have already done that.
I have tried to activate tracing as well, by setting trace enabled="true",
but accessing the trace.axd page returns a message instructing me to do just
that.
I have tried to figure out why it is ignoring these settings while still
using the database connection string contained, but with no result.
Below is the content of my web.config. Please advice!
Regards;
/jb
--8<--
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<appSettings/>
<connectionStrings>
<add name="db" connectionString="Data Source=server;Initial
Catalog=db;uid=server;password=pwd" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<customErrors mode="Off"/>
<trace enabled="true" localOnly="false" pageOutput="false"
requestLimit="50" mostRecent="true"/>
<compilation>
<assemblies>
<add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Runtime.Remoting, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="logon.aspx"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
<globalization requestEncoding="utf-8" responseEncoding="utf-8"
culture="sv-SE" uiCulture="auto"/>
</system.web>
<location path="trace.axd">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
</configuration>I may have just missed it, but I didn't see that you'd set the Web.config
settings with
Debug=True
David Wier
MVP/AsPINsider
"Jonny Bergdahl" <jonny.bergdahl@.community.nospam> wrote in message
news:96CBD94E-A832-45E9-9CA8-B515BC4339A0@.microsoft.com...
>I have a ASP.Net 2.0 web application that I am trying to debug. Problem is
>that I can't get the error message to show in the browser. It always
>returns the generic error message telling me to set customErrors="Off".
>Problem is I have already done that.
> I have tried to activate tracing as well, by setting trace enabled="true",
> but accessing the trace.axd page returns a message instructing me to do
> just that.
> I have tried to figure out why it is ignoring these settings while still
> using the database connection string contained, but with no result.
> Below is the content of my web.config. Please advice!
> Regards;
> /jb
> --8<--
> <?xml version="1.0"?>
> <configuration
> xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
> <appSettings/>
> <connectionStrings>
> <add name="db" connectionString="Data Source=server;Initial
> Catalog=db;uid=server;password=pwd" providerName="System.Data.SqlClient"/>
> </connectionStrings>
> <system.web>
> <customErrors mode="Off"/>
> <trace enabled="true" localOnly="false" pageOutput="false"
> requestLimit="50" mostRecent="true"/>
> <compilation>
> <assemblies>
> <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
> PublicKeyToken=B77A5C561934E089"/>
> <add assembly="System.Runtime.Remoting, Version=2.0.0.0,
> Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
> <add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
> PublicKeyToken=B03F5F7F11D50A3A"/>
> <add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral,
> PublicKeyToken=B77A5C561934E089"/>
> </assemblies>
> </compilation>
> <authentication mode="Forms">
> <forms loginUrl="logon.aspx"/>
> </authentication>
> <authorization>
> <deny users="?"/>
> </authorization>
> <globalization requestEncoding="utf-8" responseEncoding="utf-8"
> culture="sv-SE" uiCulture="auto"/>
> </system.web>
> <location path="trace.axd">
> <system.web>
> <authorization>
> <allow users="*"/>
> </authorization>
> </system.web>
> </location>
> </configuration>
>
First thing you need to do is ensure that your ASP.NET application is set as
an IIS application, not "just" a virtual directory. Application = web.config
gets parsed.
Second, make sure there aren't any errors in your web.config (e.g., its
well-formed XML).
Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Jonny Bergdahl" wrote:
> I have a ASP.Net 2.0 web application that I am trying to debug. Problem is
> that I can't get the error message to show in the browser. It always retur
ns
> the generic error message telling me to set customErrors="Off". Problem is
I
> have already done that.
> I have tried to activate tracing as well, by setting trace enabled="true",
> but accessing the trace.axd page returns a message instructing me to do ju
st
> that.
> I have tried to figure out why it is ignoring these settings while still
> using the database connection string contained, but with no result.
> Below is the content of my web.config. Please advice!
> Regards;
> /jb
> --8<--
> <?xml version="1.0"?>
> <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"
> <appSettings/>
> <connectionStrings>
> <add name="db" connectionString="Data Source=server;Initial
> Catalog=db;uid=server;password=pwd" providerName="System.Data.SqlClient"/>
> </connectionStrings>
> <system.web>
> <customErrors mode="Off"/>
> <trace enabled="true" localOnly="false" pageOutput="false"
> requestLimit="50" mostRecent="true"/>
> <compilation>
> <assemblies>
> <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
> PublicKeyToken=B77A5C561934E089"/>
> <add assembly="System.Runtime.Remoting, Version=2.0.0.0,
> Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
> <add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
> PublicKeyToken=B03F5F7F11D50A3A"/>
> <add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral,
> PublicKeyToken=B77A5C561934E089"/>
> </assemblies>
> </compilation>
> <authentication mode="Forms">
> <forms loginUrl="logon.aspx"/>
> </authentication>
> <authorization>
> <deny users="?"/>
> </authorization>
> <globalization requestEncoding="utf-8" responseEncoding="utf-8"
> culture="sv-SE" uiCulture="auto"/>
> </system.web>
> <location path="trace.axd">
> <system.web>
> <authorization>
> <allow users="*"/>
> </authorization>
> </system.web>
> </location>
> </configuration>
>
Do you mean that it is an error to not include the Debug attribute? I want
debug turned off, so I simply removed that attribute.
Regards;
/jb
"David Wier" <dwier@.nospam.com> skrev i meddelandet
news:OGA0FdljHHA.392@.TK2MSFTNGP06.phx.gbl...
>I may have just missed it, but I didn't see that you'd set the Web.config
>settings with
> Debug=True
> David Wier
> MVP/AsPINsider
> "Jonny Bergdahl" <jonny.bergdahl@.community.nospam> wrote in message
> news:96CBD94E-A832-45E9-9CA8-B515BC4339A0@.microsoft.com...
>
> First thing you need to do is ensure that your ASP.NET application is set
> as
> an IIS application, not "just" a virtual directory. Application =
> web.config
It is. I even deleted the application and recreated it without any change.
> Second, make sure there aren't any errors in your web.config (e.g., its
> well-formed XML).
I don't think there are any errors in the web.config, as Visual Studio don't
complain when it is loaded. Also; I thought that any web.config errors would
be logged to the event log? Event log stays silent...
Regards;
/jb
> "Jonny Bergdahl" wrote:
>
re:
!> I want debug turned off, so I simply removed that attribute.
The default behavior is debug="false".
You must set it, explicitly, to debug="true" if you want it set to true.
So, you did the correct thing, *if* you want debug set to false.
Removing the attribute sets it to the default behavior, i.e. debug="false".
However, you stated that you *want* debug set to true :
!> I have a ASP.Net 2.0 web application that I am trying to debug
If you're trying to debug your ASP.Net 2.0 web application,
you *must* set debug to true explicitly, i.e. : debug="true"
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Jonny Bergdahl" <jonny.bergdahl@.community.nospam> wrote in message
news:F9D60569-CD58-4D65-BEF9-8C2223B43D33@.microsoft.com...
> Do you mean that it is an error to not include the Debug attribute? I want
debug turned off, so I
> simply removed that attribute.
> Regards;
> /jb
> "David Wier" <dwier@.nospam.com> skrev i meddelandet news:OGA0FdljHHA.392@.T
K2MSFTNGP06.phx.gbl...
>
> However, you stated that you *want* debug set to true :
> !> I have a ASP.Net 2.0 web application that I am trying to debug
By "debugging" in this context I just meant "get rid of the bug". To do that
I want to se the error message that the web server won't display to me.
Btw, it is possible to run the application under a debugger even when the
code is not compiled for debug.
Regards;
/jb
re:
!> To do that I want to se the error message that the web server won't displ
ay to me.
To be able to see that error message, you need to set <compilation debug="tr
ue">.
If you wish to ignore reality I can't help you, nor can anybody else.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Jonny Bergdahl" <jonny.bergdahl@.community.nospam> wrote in message
news:07507F1C-BEF6-48F5-A3FC-AE229608F702@.microsoft.com...
> By "debugging" in this context I just meant "get rid of the bug". To do th
at I want to se the
> error message that the web server won't display to me.
> Btw, it is possible to run the application under a debugger even when the
code is not compiled for
> debug.
> Regards;
> /jb
> To be able to see that error message, you need to set <compilation
> debug="true">.
Besides from using the <compilation> tag for compilation, ASP.NET uses that
flag to change certain runtime behaviour. One of those is how it handles
resources returned to the browser, such as images and style sheets. When
debug is set to true, it telles the browser never to cache the content,
effectively making our application too slow to be usable. This is the reason
the debug flag always should be set to false in a production server.
The debug flag does not, however, make ASP.NET ignore the settings for
<customErrors> or <trace>, which you easily can verify by yourself.
> If you wish to ignore reality I can't help you, nor can anybody else.
Seems your reality differs wastly from mine, as I have successfully used
both the <customErrors> and <trace> settings to get the needed output on our
production servers, where we always have debug set to false.
The issue I am having is with our staging server - any web sites created
there ignores these settings. We have four separate web sites on the server,
all with different IP addresses. I have also mapped Localhost to one of
them, but browsing to http://localhost/trace.axd also displays the "Trace
error" message instructing me to do what I have already done, set tracing to
on.
Regards;
/jb
Jonny,
could you try, instead of using :
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
editing that line to just :
<configuration>
If that's the only mistake, that will eliminate the error message.
I know that you're looking for a fuller solution,
but that might enable you to continue working on the app.
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Jonny Bergdahl" <jonny.bergdahl@.community.nospam> wrote in message
news:F0E998D3-2EEE-4A81-9196-0B252C1CDC5C@.microsoft.com...
> Besides from using the <compilation> tag for compilation, ASP.NET uses tha
t flag to change certain
> runtime behaviour. One of those is how it handles resources returned to th
e browser, such as
> images and style sheets. When debug is set to true, it telles the browser
never to cache the
> content, effectively making our application too slow to be usable. This is
the reason the debug
> flag always should be set to false in a production server.
> The debug flag does not, however, make ASP.NET ignore the settings for <cu
stomErrors> or <trace>,
> which you easily can verify by yourself.
>
> Seems your reality differs wastly from mine, as I have successfully used b
oth the <customErrors>
> and <trace> settings to get the needed output on our production servers, w
here we always have
> debug set to false.
> The issue I am having is with our staging server - any web sites created t
here ignores these
> settings. We have four separate web sites on the server, all with differen
t IP addresses. I have
> also mapped Localhost to one of them, but browsing to http://localhost/trace.axd
also displays the
> "Trace error" message instructing me to do what I have already done, set t
racing to on.
> Regards;
> /jb
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment