views:

31

answers:

1

I have a newly created asp.net MVC 2.0 application that is in a completely separate solution from an existing asp.net webforms application.

Because I didn't want the user to have to log in again, I deployed the MVC application in the same site as the existing Webforms app - everything works great.

One thing has me completely perplexed though, the Webforms application uses a Third Party DLL that has nothing to do with my MVC application, yet I can't use the MVC application without including that DLL in the MVC \bin directory. Why is this required? It's not part of that application? It's even causing me issues now so I'm even more curious...

Why is this dependency to the DLL being required in my MVC application?

+2  A: 

The reason is because your parent application probably sets that in web.config in the modules or handlers section, and the IIS configuration system in IIS 7+ uses a distributed/hierarchical config system supporting web.config files.

In this case the child application web.config inherits all the settings from the parent web.config. Unfortunately ASP.NET uses the /bin directory only per-application and it has to be included in the root directory, so that means that since you probably are deploying the DLL in the /bin directory of the parent app, the child app does not know anything about it.

You could modify the parent's web.config to use a location tag and set the inheritInChildApplications so that you stop it from inheriting into the child app: http://forums.iis.net/t/994377.aspx

CarlosAg
Thanks Carlos, that is really helpful! I noticed the missing intellisense in 3.5, but after I wrapped the <system.web> it didn't inherit.This doesn't solve the problem though, since now I get an authentication error when I link to the MVC site, probably because the <authentication> and <MachineKey> sections are not inherited.I'll keep trying, but any idea why I am now getting the authentication error?
Mark Kadlec
Yes! Got it to work by adding <identity impersonate...>. Thanks you Carlos, you really helped me out.
Mark Kadlec