tags:

views:

159

answers:

4

After quite a bit of searching I think my situation is different enough I have to actually ask a question!

I have a website for public consumption and a maintenance site for the data in a virtual root beneath the website. I would like for them to both use the same /bin folder but I can't get that to work. The virtual root has different (more restrictive) IP access controls. IIS sees this:

www.abc.com ->      C:\Website
    /Maintenance -> C:\Maintenance

www.abc.com has a C:\Website\bin and C:\website\web.config.

I would like /Maintennace to also use C:\Website\bin. They seem to 'cascade' web.configs - C:\Website\web.config defines some things and refers to assemblies in its bin folder. When /Maintenance fires up I get errors about not being able to resolve assemblies referenced in C:\Website\web.config. C:\Maintenance\web.config also gets processed.

IIS6, ASP.NET 3.5, Win2k3

Is this doable?

+1  A: 

You can un-register DLL files from C:\Maintenance\web.config. I used to do so when I created a sun virtral directory under a DotNetNuke root website. For Example, if you are referencing a HTTP Module in your C:\website\web.config:

<httpModules>
  <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>

You can remove the reference from C:\Maintenance\web.config:

<httpModules>
      <remove name="ScriptModule"/>
</httpModules>
Khalil Dahab
Yes you can. But for example I have an HTTP Handler in c:\website\web.config that lives in the DLL located in C:\website\bin. When /Maintance fires up I get an error from its processing of c:\website\web.config that cannot find the assmebly the handler lives in.
n8wrl
Then remove all HTTP Handler : <httpHandlers> <remove verb="*" path="*"/> </httpHandlers>Post your c:\website\web.config, and I will show you how to clean it.
Khalil Dahab
A: 

You'll have to create a separate bin inside your virtual directory / app.

ScottE
That's what I've done for some time now, but it means i have to keep copies of the DLL's from website/bin so website/web.config processing works when /maintennace is activated.
n8wrl
Let me know if you find a better way, besides the GAC, because this is a pain in the arse.
ScottE
+1  A: 

I'm slightly unclear as to what the objective is from your question, but if you're looking to process other directories outside of the bin directory for assembly references for your Maintenance site, you may be able to make use of the <probe> element of the web.config runtime configuration.

It allows you to specify additional paths to resolve references, rather than just "bin". Since this is very similar to this question asked earlier today, I'll just link it so you can review the examples and answers there. Hopefully it helps you.

womp
@womp: Thanks for the links. My intent is simple - I want to use the same codebase for a public website and data maintenance via a restricted URL. Virtual directories let me restrict the IP range to accept requests from. So, a virtual root with these restrictions under the website seemed like a logical way to go. Now to share the codebase...
n8wrl
A: 

What I ended up doing was moving /Maintenance underneath C:\Website and getting rid of the virtual directory altogether. This allows them to share the same /bin and I end up with the same URL's anyway.

n8wrl