I have two web applications developed using .net framework 4.0. I want to host both web application using a single virtual directory in IIS 7.0.
My purpose behind single virtual directory hosting is "Both web apps should use same application domains so that web caching etc. are can be available to both applications."
Is there any way to achieve the same by single virtual directory or by some other way?
First, you don't need any virtual directories. You do want two application roots though, which can be virtual or real directories (Make either type of folder an application). Put them under the same site and the rest works fine, the separate applications
will have separate configs and will not inherit each other's settings.
As Jeff mentioned, you can easily achieve this by creating 2 application under your site. The application root path can be different but they will share the same domain. e.g. You've created app1, app2 for the same site, then you can access your two app with
http://www.domain.com/app1,
http://www.domain.com/app2.
Feel free to let me know if you need further help, thanks.
Simply publish the two apps under two folders in the web site root folder. In the IIS Manager, right click each folder and choose to make them an application. Provide appropriate application pool details. They can share thje same app pool if you wish
(normal).
Thanks to all for reply. I try according to your reply. But when i am running a both web application at the same time, In-Memory caching is not shared between both application. It means both applications are running in different Application Domain, even
have same application pool.
My purpose to host the two or more web applications in same App-Domain so that in-memory cache can be shared between all applications.
What is your purpose of sharing in-memory cache between the two applications?
I have two web clients one is Asp.Net web application and another one is REST 4.0 service. Both are using the same Data API to access the database.
If both web apps are not sharing cache, sometimes it may possible to one of web app get dirty data i.e. not synchronized with database. So i want to share a cache. Since its only possible when publish both apps such that both are execute in same memory area.
Simply publish the two apps under two folders in the web site root folder. In the IIS Manager, right click each folder and choose to make them an application.
Hi jeff,
I have a website and i want to develop a mobile site for the same. Is it possible to create a new application and access files like images of main website in new one or I have to create a child application.
Thanks in advance!!
Mark as reply if my answer is helpful to you.....
Best
Gurpreet Singh Labana
nitinjain
6 Posts
How to host multiple web applications in single virtual directory?
Jun 14, 2012 12:13 PM|LINK
Hi,
I have two web applications developed using .net framework 4.0. I want to host both web application using a single virtual directory in IIS 7.0.
My purpose behind single virtual directory hosting is "Both web apps should use same application domains so that web caching etc. are can be available to both applications."
Is there any way to achieve the same by single virtual directory or by some other way?
C# "IIS" Caching _IIS7 w3wp cache IIS 7 cache issues .net 4.0 deployment IIS7
jeff@zina.co...
3379 Posts
MVP
Moderator
Re: How to host multiple web applications in single virtual directory?
Jun 14, 2012 01:59 PM|LINK
First, you don't need any virtual directories. You do want two application roots though, which can be virtual or real directories (Make either type of folder an application). Put them under the same site and the rest works fine, the separate applications will have separate configs and will not inherit each other's settings.
Jeff
nitinjain
6 Posts
Re: How to host multiple web applications in single virtual directory?
Jun 15, 2012 06:02 AM|LINK
Hi,
Thanks for reply. I am novice to IIS deployment. Can you please explain me how to publish the web app as per your previous reply?
Lloydz
2335 Posts
Microsoft
Re: How to host multiple web applications in single virtual directory?
Jun 20, 2012 03:22 AM|LINK
As Jeff mentioned, you can easily achieve this by creating 2 application under your site. The application root path can be different but they will share the same domain. e.g. You've created app1, app2 for the same site, then you can access your two app with http://www.domain.com/app1, http://www.domain.com/app2.
Feel free to let me know if you need further help, thanks.
jeff@zina.co...
3379 Posts
MVP
Moderator
Re: How to host multiple web applications in single virtual directory?
Jun 20, 2012 10:43 AM|LINK
Simply publish the two apps under two folders in the web site root folder. In the IIS Manager, right click each folder and choose to make them an application. Provide appropriate application pool details. They can share thje same app pool if you wish (normal).
Jeff
nitinjain
6 Posts
Re: How to host multiple web applications in single virtual directory?
Jun 26, 2012 12:18 PM|LINK
Hi,
Thanks to all for reply. I try according to your reply. But when i am running a both web application at the same time, In-Memory caching is not shared between both application. It means both applications are running in different Application Domain, even have same application pool.
My purpose to host the two or more web applications in same App-Domain so that in-memory cache can be shared between all applications.
"IIS" Caching cache applicationpool .net 4.0 ApplicationDomain
kctt
777 Posts
Re: How to host multiple web applications in single virtual directory?
Jun 29, 2012 05:31 AM|LINK
What is your purpose of sharing in-memory cache between the two applications?
nitinjain
6 Posts
Re: How to host multiple web applications in single virtual directory?
Jun 29, 2012 08:56 AM|LINK
I have two web clients one is Asp.Net web application and another one is REST 4.0 service. Both are using the same Data API to access the database.
If both web apps are not sharing cache, sometimes it may possible to one of web app get dirty data i.e. not synchronized with database. So i want to share a cache. Since its only possible when publish both apps such that both are execute in same memory area.
"IIS" Caching cache applicationpool .net 4.0 ApplicationDomain
gurpreetsing...
1 Post
Re: How to host multiple web applications in single virtual directory?
Mar 05, 2013 03:49 PM|LINK
Hi jeff,
I have a website and i want to develop a mobile site for the same. Is it possible to create a new application and access files like images of main website in new one or I have to create a child application.
Thanks in advance!!
Best
Gurpreet Singh Labana