Rick Strahl's Weblog  

Wind, waves, code and everything in between...
.NET • C# • Markdown • WPF • All Things Web
Contact   •   Articles   •   Products   •   Support   •   Advertise
Sponsored by:
West Wind WebSurge - Rest Client and Http Load Testing for Windows

ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts


:P
On this page:

In my last post I mentioned that I had some issues getting a version 1.1 app to run with 2.0 installed on a higher level.

 

Here’s the scenario: My main site is set up with ASP.NET 2.0 and there are several subsites – each configured as virtuals – to run with ASP.NET 1.1. So my main site runs 2.0 and my Web Log running .TEXT runs 1.1.

 

Trying to run the Web Log fails however:

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized attribute 'xmlns'.

Source Error:

 

Line 1:  <?xml version="1.0"?>

Line 2:  <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">

Line 3:          <!--

Line 4: 


Source File: D:\Westwind\web.config    Line: 2

 

This namespace reference comes from the Root Web, the 2.0 web, not from the 1.1 web.config running for the current application.

 

The problem is the Web.Config schema changes in the 2.0 files. Now I’m not really sure why IIS is even looking in the root directory since the application officially runs in the virtual and should only be looking at the web.config file in the virtual not the root.

 

Removing the offending namespace reference makes the app run but I suspect once I start adding new 2.0 tags to the web.config in the root it will break the code in 1.1 again.

 

This pretty much puts an end to my consideration of putting 2.0 on my life server right here at least for the root site...

 

Anybody have any idea why ASP.NET is even looking in the root? If I understand the hierarchy correctly it should go machine.config/virtual web.config/sub dir web.config… Since the directory of the application is a virtual the application tree should start there.  Hmm… the root may be a special case though because the client side library stuff is copied there.

 

 

 


The Voices of Reason


 

Michael van der Veeke
May 11, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

You need to change the mappings page in IIS to make it use the 1.1 framework instead of 2.0. I had the same issues and changing the reference fixed this.

Good luck

Michael
michael [at] property4view [dot] com

Rick Strahl
May 11, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

Michael, which mappings page? The app IS running ASP.NET 1.1 (ie. it's set in the IIS 6 ASP.NET settings page that ASP.NET 2.0 installs). The problem is that it's looking at the 2.0 web.config file in the Web Root.

Andrew
May 25, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

In the IIS snap-in, there is a new tab, "ASP.NET". On this tab, there is a dropdown, "ASP.NET version". I changed this from 1.1 to 2.0 for the site and the app was able to run. Apparently, the 2.0 parser is required to use the 2.0 version of the config file.

I'm running w2k3, and have the 2.0 site running as an app root (not just a virtual folder) on it's own TCP port (http://localhost:201).

hth,
/Andrew

Rick Strahl
June 02, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

Y'all missing the point here <g>. The error above isn't coming from the 1.1 application I'm running - the virtual is set to run ASP.NET 1.1. The error is coming from the ROOT web that sits above the 1.1 app that is running. The error occurs because the 1.1 virtual dir app is looking at the ROOT's 2.0 web.config file.

Unless you set up the root site to ASP.NET 1.1 any access to a 1.1 app under a 2.0 root will fail. This is a fatal flaw IMHO as you can't stick ASP.NET 2.0 on a root Web and hope to run 1.1 apps beneath it,unless you don't use a web.config at the root or one that is compatible with 1.0.

This is reliably reproducible for me. If you think this is bogus try it out yourself and vote to get this fixed:

http://lab.msdn.microsoft.com/ProductFeedback/viewfeedback.aspx?feedbackid=e6c107e5-8849-4541-8355-0017ba211a86



Jacob
June 28, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

We experienced the same thing at my company. I agree that this should not be "by design" and needs to be fixed.

Chuck
July 17, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

I'm looking to do something similar. Have you found a work around yet?

suma
July 18, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

try to run C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\aspnet_regiis -i

Hemant
July 18, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

Awesome. It worked for me. turns out u have to type /aspnet_regiis.exe -i

Rick Strahl
July 18, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

That doesn't solve the problem. That just registers everything to use ASP.NET 2.0, which is not what you want in most cases...

Rocky Dotson
October 07, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

I know this thread is old, but I just recently fixed a problem that was the reverse of this one as far as frameworks go. I was running DotNetNuke in 1.1 on the root directory and a 2.0 app in virtual and the dnn web.config file was triggering errors in the 2.0 app. The way I fixed it was adding <clear /> to the application level web.config file for each area that triggered an error in the root web.config. For example, I added <system.web><httpModules><clear/></httpModules> because that line was referenced in the error code as coming from the machine level web.config file, but wasn't included in my app level version. I did this for each error until the app worked again. Since my problem was the other way, I didn't have to deal with the error you have, but maybe you could add <clear /> after the <configuration> tag before anything else is added (which in hindsight, if that works, would have saved me a lot of time). Anyway, hope this helps.

Rick Strahl
October 07, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

Rocky,

Yes I think this might get around some of the issues. But if you have a complex 2.0 config file at the root this is likely not to work as any 2.0 specific setting will break the child projects.

Well, with any luck I will be able to migrate all my apps to 2.0 and the one that doesn't run on 2.0 (this one - .Text) I can move out of the root.

Rick Strahl
October 07, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

Oh and the namespace attribute was removed from the web.config schema for the RTM version so at least the web.config isn't right out of the bat incompatible.

Mike Grimm
October 11, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

We have a similar problem using only ASP.Net 1.1. Where as the virtual application is picking up config settings from both it's web.config file and that of the root application. On the pysical drive they are in different places completely but in the IIS tree the virtual is right under the root. It's picking up both application variables for "Database.ConnectionString" and combining them with a comma between. This only happens on the w2k3 (6.0) server and not on the localhost on XP (5.1). Which made debugging the problem a very late night!

We had assumed that a virtual application would would run completely separate. The application pools aren't even the same. They are isolated to one web each!

What I need to know is if there is a way to correct this??? Virtual apps should be isolated. My vote too is that this is a flaw!

"By design", that how consultants talk so they can charge you for their mistakes!

Mike Grimm
October 11, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

...continued from last post, as I resolve this.

Then when you have to consider session state and cookies and how they should work down through the structure. Maybe this is consistant. I guess I have no choice but to bump my "root" application down one folder.

.. works, kinda ...

Ok, if I move the bin folder and the web.config down one level and create a new virtual application on that sub folder it fixes the problem. Unfortunately this also breaks my root application as I'm now losing application variables on the new virtual (of course).

So the only solution to have multiple applications with separate web.config files is to run them in parallel virtual sites in IIS and skip the root app or they will inherit it's web.config also. Aurghhhh! Now I get to restructure a whole website with multiple applications!

Mike Grimm
October 11, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

Ok, final post...

In my case I can work around my last issue by splitting off my one existing application to a sub-domain (hence entire website) since it is a completely separate application. Then I can keep my other structure and not lose my application variables in a virtual.

RUN SEPARATE APPLICATIONS IN A SUB-DOMAIN. This my be a posible solution if your applications have no inter-relations. You can make cookies work across sub-domains but what a pain!

Raj Chaudhari
November 07, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

This is absolutely frustrating. I have to integrate Community Server 1.1 with my ASP.NET 2.0 application and the client wants the link to forums as www.domainname.com/forums.

Because of this bug this is not possible now. I am left with just 1 option and that is to create a sub domain

Microsoft needs to release a patch for this ASAP.

Cheers,
Raj Chaudhari
MCAD.NET

Luis Abreu
November 08, 2005

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

Hello guys.

hum...isn't this what was expected to happen? I mean, doesn't the definitions placed at a specific level of a web app result from the hierarchical combinations of all the config files from the current dir to the machine.config file? if this is true, then this is the expected behavior though it really sucks as you all have said...

Craig Mellon
January 18, 2006

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

Hi All,

I too have had this problem.

You do have to use a subdomain, but you can still get your folder structure to work. WIth ASP.net 1.1 & 2.0

i.e. for Raj Chaudlhari's problem do the following.

Setup your new site using a seperate sub domain name, then in your original site add a new folder through IIS and in the settings change it to a permanant redirectorion. in the virtual root settings.

Then when you goto www.domainname.com/forums it will auto redirect to the new subdomain.

L Norton
March 02, 2006

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

We had the same problem and got around the issue by specifying 2.0 specific items, such as membership, role providers and namespaces, in the framework specific web.config: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config. I know this may not be possible for many, but in our case it worked. The 1.x apps running under a 2.0 site do not inherit from the framework's web config. Of course, if you are running another ASP 2.0 app on the same server, the web site’s web config can specify a different membership provider or namespaces as long as no 1.x virtual directories are running under that app.

QUOC CHE
March 27, 2006

# how to make IIS run with ASP dot net

i installed .NET Framwork after i installed IIS 5.1 . now i can't run asp.net on iis
please help
thanks

Bob
April 14, 2006

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

This occurs by design. Even though it's a virtual directory, the application will work it's way down the folders in a virtual manner. So all apps will look in the current web.config, then look down the heiarchy to the root web.config. This behavior does not take applications into account. The advantage to this is that you can set up all your common settings in the root web.config, then set you application specific settings in your virtual directory or subweb. The downside is what you are experiencing, and don't know of a workaround.

Knut Hamang
May 04, 2006

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

I also have the same problem. Seems like the only solution is to add an ISAPI_rewrite filter or do a redirect (which is not pretty regarding statuscodes sent to the browser)

What were they thinking!

Peter's Gekko
June 21, 2006

# Web.config combinations going bad Incompatible entries and incompatible framework versions

When an asp.net application is started it processes the web.config file. Doing so it is combined with...

Dominic Plouffe
August 31, 2006

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

Hi All,

I know this is an old thread but found it while searching on this exact problem which I was experiencing. I resolved the issue by putting my .net 1.1 app on a seperate application pool.
It seems to do the job beautifully.


Scott
September 14, 2006

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

We have had the same issue and were able to correct it by:
1) removing the namespace at the top and
2) configuring the 1.1 application to ignore the new sections (ConnectionStrings, etc.). See http://codebetter.com/blogs/peter.van.ooijen/archive/2006/06/23/146738.aspx

HTH

JT
October 11, 2006

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

Not sure if this is possible for everyone with the problem described in Rick's post, but we had the same problem and were able to use our firewall/application-switch (ISA) to solve it. We set the sites up like this:

FW Rules Bound Web Servers Environment
----------------- ------------------- -------------
hostname:80 webserver1:880 ASP.NET 2.0
hostname:80/Vdir webserver1:980 ASP.NET 1.1

Ron W.
October 11, 2006

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

Lots of feedback here so I'll just throw mine in as well. I too struggled with having 1.1 and 2.0 apps together in various combinations. In the end if I set up separate application pools for my 1.1 and 2.0 apps and also separate websites for 1.1 and 2.0 they were all able to function on the same server. As a side note, I did have to reboot the server after splitting things up for it work work completely.

Rick Strahl's Web Log
October 15, 2006

# ASP.NET 2.0 VS.NET Project Issues - Rick Strahl's Web Log

The new way that VS.NET manages Web projects is very different from the way things worked in VS2003. For my first try at a relative simple tasks I was thwarted by the shortcomings of this new approach...

Getting Started
November 06, 2006

# ASP.NET Forums - ASP.NET 1.1 Application Folder Does Not Work If It Is Inside An ASP.NET 2.0 Application Folder


Configuration and Deployment
November 22, 2006

# ASP.NET Forums - Problem with nested applications in v1.1


Chris
December 06, 2006

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

L Norton, thank you so much for your comment above about putting the 2.0 config items in the global web.config instead. That was the answer for me as well. I really appreciate it. You'll likely never see this post in reply unfortunately, but hopefully this message of appreciation will find it's way to you somehow.

Getting Started
January 22, 2007

# ASP.NET Forums - Need a reality check: ASP.NET 2.0 and Root Web Deployments


Sonstiges
January 26, 2007

# ASP.NET Zone - Fehler in web.config

Diese Community behandelt ASP.NET, ASP.NET AJAX sowie alle weiteren Microsoft Webtechnologien. Fragen zu ASP.NET, ASP.NET AJAX, Classic ASP, ADO.NET, Membershipprovider, Loginprovider, RoleProvider, GridView, DataGrid, usw. können im ASP.NET Forum gestellt werden.

Geek-in-the-House
February 08, 2007

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

To solve this issue...just right click the virtual directory...select properties....choose the ASP.NET tab...and change the version from 1.1 to 2.0

Will
February 17, 2007

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

I love it how some guys spout the Microsoft answers. How about you join the real world because this is a real world problem, not the simulated crap Microsoft doesn't want to support.

Someone already answered this flawlessly: just run your 2.0 and 1.1 applications in seperate app pools.

ASP.NET Forums
June 19, 2007

# Problem with nested applications in v1.1 - ASP.NET Forums


ASP.NET Forums
July 10, 2007

# ASP.NET 1.1 Application Folder Does Not Work If It Is Inside An ASP.NET 2.0 Application Folder - ASP.NET Forums


Jochen
April 23, 2008

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

Above workaround doesn't work for me with Windows 2008 and IIS 7.
The root application can't be removed.

But there might be another workaround: use a reverse-proxy server and let it handle all the requests from the internet to your domain (instead of being done by your regular web server). The reverse proxy server forwards all requests to your original web server (which is now in the background and never accessed by the internet directly).

All applications requiring to run with ASP.NET 1.1, you put them to another (virtual) webserver and configure its root directory and all applications to use ASP.NET 1.1. For those applications now, you configure the reverse proxy to forward the requests to your new/additional Asp.Net-1.1-webserver (instead of your main webserver running ASP.Net 2.0 applications which receives all other forwardings).

Examplarily, you can setup an Apache Reverse Proxy server in front of your IIS webserver to do the job. More information on Apache Reverse Proxy configuration can be found at the website of Apache.

Jochen
April 23, 2008

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

The application pools on Win2008/IIS 7 can't be isolated more than now - at least I don't find anything to additionally separate the virtual directory and its application pool from the root directory with its application pool. Root application already runs its pool with integrated mode of ASP.NET 2.0; the virtual folder is configured as application and runs a separate application pool with ASP.Net 1.1. So, above solutions don't work for me :(

motogeek
September 10, 2008

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

That <clear /> mentioned aboved worked like a charm for me. I thought if you used a seperate web.config in your vitual directory of a root, it ignored the webconfig in root. But appears it inhererits the settings. I had a httpmodule like person above causing my web servince in the virtual to fail. The clear fixed my problem. I have been looking for this fix for sometime.

Thanks...

Bev
March 27, 2009

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

We have been struggling with this same issue, having 1.1 websites in virtual directories and trying to put a portal page into the Default Web app; that portal app being 2.0; we kept hitting tags in the web.config of the 2.0 default that caused the 1.1 app to generate error. Initially tried moving all offending sections of the 2.0 web.config into the framework web.config as suggested; but uneasy due to the large amount of customization this entailed. Found simple low-tech solution: leave the Default web app as simple Default.htm page, no web.config in that folder; leave the portal app as virtual directory under Default; put a javascript redirect in the Default.htm page to go to the portal app. Now we are able to click on link from portal page to our 1.1 apps, and since they don't inherit the web.config it works fine.

Scrum
April 13, 2009

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts

L Norton described the solution in his post on March 02, 2006. Inheritance starts with the machine.config file that resides in framework-specific directories on the web server, such as 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG' or 'C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG'. You can also create a web.config file in these directories to contain the second level of inheritence. PLACE YOUR FRAMEWORK-SPECIFIC WEB.CONFIG CODE IN ONE OF THESE DIRECTORIES. Any code inherited from web.configs in the server root or lower do not have framework-specific focus.

Master Of AspX :)
June 24, 2010

# re: ASP.NET 2.0 Web Root ASP.NET 1.1 virtuals and Web.Config Conflicts


C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIG

add the 3.th line bellow settings into Machine.config it will work.


<section name="system.webServer" type="System.Configuration.IgnoreSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowLocation="false" />

West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2024