0

I have two ASP.NET web forms application and I need to run them independently of each other. But for logistical reason of maintenance I prefer to have one as a Sub-folder of the other. Example:

c:\inetpub\wwwroot\MyAppl1
c:\inetpub\wwwroot\MyAppl1\MyAppl2

Each application has its own Form Authentication (different name log in pages)

First I create the MyAppl1 as web site and MyAppl2 as virtual directory. But then running a page in the MyAppl2 gives error:

The virtual path '/Site.Master' maps to another application, which is not allowed.

The above Site.Master is in c:\inetpub\wwwroot\MyAppl1\MyAppl2

Now I am thinking that maybe virtual directory was not the best approach. Can I create MyAppl2 in IIS as a separate Site pointing to a physical directory which is in sub-directory of another site?

Hidalgo
  • 847
  • 1
  • 12
  • 35
  • [Virtual `directory` is different from virtual `application`](http://serverfault.com/a/102526/67148). You will likely also have to deal with [web.config inheritance](http://weblogs.asp.net/jongalloway//10-things-asp-net-developers-should-know-about-web-config-inheritance-and-overrides) – EdSF Aug 24 '14 at 19:10
  • @EdSF Thank you; I will read the article you linked. – Hidalgo Aug 24 '14 at 19:13
  • The solution turned out to be placing a period in front of the slash. As in './Site.Master' I don't know why it works but it does. – Hidalgo Aug 25 '14 at 14:12
  • 1
    [This](http://stackoverflow.com/a/275791/304683) should explain the "single dot" that resolves the _file location_ (so your site _doesn't point to a `Master Page` in **another application**)..note that important statement (if it causes other "unexpected" issues). Hth... – EdSF Aug 25 '14 at 17:39
  • @EdSF Thank you very much for the link. Very helpful. – Hidalgo Aug 25 '14 at 18:08
  • @EdSF Last question; I promise. If my Site.Master file always in the same physical folder as my aspx pages, would I be better off specifying location simply as file name (e.g. "Site.Master") instead of "./Site.Master"? Or it would be the same? – Hidalgo Aug 25 '14 at 18:17

0 Answers0