Friday, July 31, 2009

Asp .Net problem: How to make two applications share the same folder?

I am trying to deploy a new ASP .NET application on our productive server. The Global.asax seems to need to be in the root folder of the IIS. But there is another Web application, so I would like to put mine in a subfolder. How to reference the pages and code files from the Global.asax? In a Windows App I would make a namespace, but placing aspx pages in a /bin doesn't sound good to me.

Asp .Net problem: How to make two applications share the same folder?
ASP.NET applications correspond to IIS applications, which are on a per-folder basis. IIS application architecture is not designed to have two different applications running in the same folder; you need to create a virtual directory underneath your main application. If you remove the web.config and global.asax files from your 2nd application, it should look to the parent application for those files.





Edit: RE your additional details - simply create a new virtual folder underneath your main IIS site, and put your application in there.





Or, maybe I am misunderstanding the problem. Do you want to have two root-level applications? If so, you can simply create more IIS websites and assign specific HTTP headers to each one (for example, aaa.com to site 1 and bbb.com to site 2; IIS will route the requests to the correct site, even though both domains point to the same IP).


No comments:

Post a Comment