I have my main website’s application on my server at C:\inetpub\wwwroot, which I can view at http://www.mysite.com
I’ve created another separate MVC web application, named Supapp, at C:\inetpub\Supapp. I’d like to set it up so that if I visit http://www.mysite.com/Subdir, it will run my Subdir app.
So I went into IIS, expanded my existing website, and added a new Application, pointing the root folder to C:\inetpub\Supapp\.
When I go to view http://www.mysite.com/Subdir, I get a compilation error:
Compiler Error Message: CS0246: The type or namespace name ‘MySite’ could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 98: <add namespace="System.Web.Mvc.Html" />
Line 99: <add namespace="System.Web.Routing" />
Line 100: <add namespace="MySite.HtmlHelpers" />
Line 101: </namespaces>
Line 102: </pages>
Source File: c:\inetpub\wwwroot\web.config Line: 100
So for some reason, my sub application is getting an error from trying to load a namespace from the parent application.
Is there a way around this? The Subdir application is in a completely different directory.
config files are hierarchical, your sub web.config inherit things from your root .config. If you want certain parts to be ignred you can add
inheritInChildApplications="false"attribute to tags you don’t to be inherited.For your case add
inheritInChildApplications="false"to your aplication rootlocation