0

I have a domain with default top-level site a .Net 2 app. And lots of virtual directories underneath with different apps. I can't get a .Net 4 virtual directory working.

I have read:

.net 4.0 inheriting .net 3.5 web.config?

and I have a similar issue as: Disable web.config inheritance? which has not been solved - the answers to that question that have been given are to use inheritInChildApplications, which can't go around the configSections tags.

I've managed to stop all .Net 2 subapps of the domain from inheriting the top-level web.config settings, but for the .Net 4 app I can't seem to.

<location path="." inheritInChildApplications="false"> 

is wrapped around the System.Web section of the parent .Net 2 app, and and I have

<clear/> 

in every section in the Web.Config of the .Net 4 virtual directory app.

Is there any other solution? Perhaps the parent .Net 2 app could be placed on a virtual directory, and the top-level site request could be URL ReWritten without the user's knowledge?

Community
  • 1
  • 1
Kenny
  • 303
  • 3
  • 13
  • I think using the URL Rewrite module in IIS7 I can re-write requests to the domain and service them with a .Net app in a sub-directory on a peer with all the other applications co-hosted at the domain. Is that the normal way to host a domain with multiple applications in Asp.Net/IIS7? – Kenny Mar 23 '11 at 16:10
  • The top level .net 2 app doing the redirect would still have a web.config, where the rewrite rule lives. :\ would that still cause inhertiance issues? – Kenny Mar 23 '11 at 17:00

1 Answers1

1

No, you can't stop it inheriting, (the InheritInChildApplications=False fix doesn't cover enough of the top level Web.Config to fix this issue), but you can remove the top level .Net 2 app and redirect requests.

Using the URL Rewrite module to route requests that would have gone from your top level web application to another "web application" in virtual directory under the web site in IIS, removing almost everything from the top level Web.Config.

No top level .Net 2 app means nothing for the .Net 4 app in a virtual directory to inherit from.

IIS setup before:
Web Site -- .net 2 app "root"
|
|-- .net 2 app "one"
|-- .net 4 app "two"(not working!!)

IIS setup after:
Web Site -- rewrite requests to .net 2 app in virtual directory
|
|-- .net 2 app "one"
|-- .net 4 app "two "
|-- .net 2 app "root"

Kenny
  • 303
  • 3
  • 13