0

Normally an ASP.NET MVC application can be deployed by placing the application folder in the virtual Directory.

The application folder contains

  1. bin folder
  2. Scripts Folder(If needed)
  3. Views folder
  4. Global.asax file
  5. web.config file

But, I want to place the bin folder outside the application folder so that I can deploy more applications in a single application folder. All applications share the bin folder and session also get shared.

What I want to do
..Virtual Directory
..\bin
..\App1Name\App1Contents
..\App2Name\App2Contents
..\App3Name\App3Contents
..web.config

I already achieved this for web application with web forms without Global.asax file. But in MVC application I am unable to shared the bin folder.

How to achieve it?
Where I need to place the Global.asax file?
How the route all the applications with bin folder placed outside the Applications?

Thanks in advance

2
  • "deploy more applications" & "share the bin folder and session also get shared". It sounds like you want to make a single, bigger application. Commented Oct 13, 2014 at 14:43
  • Yes, I want to create a single bigger application. But each sub application have different functionality, views and controller. Only the session needs to be shared. Commented Oct 14, 2014 at 4:22

2 Answers 2

4

This is not possible. You were able to achieve this with Web Forms because each individual page is in effect it's own application. However, MVC works differently. Many factors, not the least of which is the routing framework, requires that the web application be secluded. You cannot deploy multiple MVC applications to the same document root. You can deploy a second MVC application to a virtual directory within the first, but be advised that the web.config of the outermost application will affect the inner application as well.

Sign up to request clarification or add additional context in comments.

2 Comments

If the common bin folder is not possible then how I suppose to share the session.
By setting matching machine keys for each application. See: blogs.msdn.com/b/httpcontext/archive/2012/06/22/…. It's focused on setting up a Web Farm, but the principle is the same. FWIW, sharing a bin folder has nothing to do with this anyways.
1

Based on the fact that your applications are sharing common binaries already, you may want to look into using MVC Areas to facilitate a logical separation between applications (but have them all as part of a single application). The following link describes this in more detail: MVC Areas

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.