web.config ignored!?!?!


J

Jonny Bergdahl

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>
 
Ad

Advertisements

D

David Wier

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
 
G

Guest

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
 
J

Jonny Bergdahl

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
 
J

Jonny Bergdahl

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
 
J

Juan T. Llibre

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 español : http://asp.net.do/foros/
===================================
 
Ad

Advertisements

J

Jonny Bergdahl

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
 
J

Juan T. Llibre

re:
!> To do that I want to se the error message that the web server won't display to me.

To be able to see that error message, you need to set <compilation debug="true">.
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 español : http://asp.net.do/foros/
===================================
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.
 
J

Jonny Bergdahl

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
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
 
J

Juan T. Llibre

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 español : http://asp.net.do/foros/
===================================
 
J

Jonny Bergdahl

<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.

No difference.

As far as the MSDN documentation is concerned, that is the correct namspace
for a ASP.NET 2.0 web.config;
http://msdn2.microsoft.com/en-us/library/ms228147(VS.80).aspx
I know that you're looking for a fuller solution,
but that might enable you to continue working on the app.

Just as long a solution is found, I will be happy.

Regards;
/jb
 
Ad

Advertisements

J

Juan T. Llibre

re:
!> As far as the MSDN documentation is concerned, that is the correct namspace
!> for a ASP.NET 2.0 web.config;

Don't believe all the documentation you read.

;-)

You *can* use it, but you'll lose Intellisense if you do.

Is your web.config very old ? Maybe created with a beta version of VS ?

With the release version, when you create a web.config in an
application which doesn't have one, what VS includes is this :

<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->

<configuration>

....etc.

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
is *not* included when a new web.config is created in the release version of VS.

Only "<configuration>" is included.

Try this :

Save your web.config ( rename it to : "web.config.old" )
and create a new web.config in VS 2005.

You'll see that VS 2005 does *not* include the xmlns attribute.
Your files should run with the "plain vanilla" web.config created by VS 2005.

re:
No difference.

Then, you have other mistakes.

Try adding, one by one, to the new web.config you create in VS 2005,
the configuration settings you have saved in "web.config.old" until you find the culprit setting.




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
 
J

Jonny Bergdahl

Try adding, one by one, to the new web.config you create in VS 2005,
the configuration settings you have saved in "web.config.old" until you
find the culprit setting.

It is not an issue with the web.config file itself, it seems to be an issue
with the setup (IIS? Machine?).

I now have four different sites set up on this server. All web.config file
settings having to do with tracing and custom errors is ignored for all
sites. The new config files were created from scratch in Visual Studio. All
other settings works as expected. No errors are logged to the application
log.

Any ideas (aside from rechecking the web.config file for the 1000th time) is
highly appreciated.

Regards;
/jb
 
Ad

Advertisements

W

Walter Wang [MSFT]

Hi Jonny,

You may try to re-install ASP.NET 2.0 or manually re-registering ASP.NET
script map in IIS by running aspnet_regiis.exe
(http://msdn2.microsoft.com/en-us/library/k6h9cz8h(VS.80).aspx).

Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top