3

Some specs:

  • IIS 7.5
  • ASP.Net MVC3

I have three MVC3 applications I would like to host:

  1. Project A
  2. Project B
  3. Project C

I want to get the URLs to be like this, respectively:

  1. http://domain/
  2. http://domain/ProjectB
  3. http://domain/ProjectC

So in IIS, I have the default website, which points to the folder for ProjectA. I then added two Applications to it, one pointing to ProjectB, and one to ProjectC, and their respective folders on the hard drive. I am storing the sites in C:\sites. Each project has a folder in C:\sites where the application's files reside. As you can see, the sites are not nested at all on the server.

When I load http://domain/ProjectB, it is trying to load configuration values from the ProjectA web.config. Obviously this is not what I want, and I'm not that awesome at server configuration. I got it working by wrapping most of the ProjectA web.config in a location tag like so:

<location path="." inheritInChildApplications="false" >
    <!-- Lots of web.config stuff for ProjectA -->
</location>

I'm not really a fan of this, it feels wrong. To me, it seems like a nested Application in my site in IIS should not even know about the parent site. What am I doing wrong? I'm sure it is something really small. I would have made ProjectA an Application, but I don't want the alias on it, as I want http://domain/ to pull it up for the users.

Again, I am not that knowledgeable about server stuff, it just isn't fun to me, hence why I'm asking y'all!

Thanks!

Gromer
  • 9,861
  • 4
  • 34
  • 55

2 Answers2

3

That is how it works. By default, asp.net applications inherit their parents web.config, and you either need to override those values in your lower web.config or wrap it in an inheritInChildApplications="false" attribute like you did above.

One possible option is if you can make your home page at the root of the site NOT an asp.net application. If you can't, you're stuck doing this.

Erik Funkenbusch
  • 92,674
  • 28
  • 195
  • 291
0

on goDaddy you can create iis virtual directories with "set application root", which then makes each director with "set application root" set act as a root directory (just as you want). The user don't notice anything. So you could look and see if you have that option?

Wolf-Kun
  • 679
  • 6
  • 12