简体   繁体   中英

Specify separate web applications within same solution - Visual Studio 2012

I have a Visual Studio ASP.Net Web Solution. On our live website, IIS is used to differentiate several different applications within this single solution. It works without a problem there, but when I open the entire solution up with visual studio, some parts cannot be found.

See example structure below... If I am working on something within "Application 2", it does not recognize any code within that "App_Code" folder because it is looking at my root "App_Code" folder instead. My question: Is there a way to manage multiple web applications under one solution in Visual Studio?

Example structure:

Root - Main Application
  App_Code
  App_Data
  Folder 1
  Folder 2
  Folder 3
  web.config
  Application 2
     App_Code
     App_Data
     Folder Inside
     Another folder
     web.config
  Application 3
     App_Code
     App_Data
     Folder 1
     Folder 2
     web.config

Each VS solution can have multiple projects, so... you can just add each Application as a Project in your solution.

One way to do it would be:

  1. Create a new BLANK/EMPTY solution
  2. Right click on the solution name and select "Add > Existing Website" and select your ROOT folder.
  3. Repeat step 2 but this time select the folder "Application 2"... do the same for all projects.

At the end you will end up with something like:

- SOLUTION
+- Root
+- Application 1
+- Application 2

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM