简体   繁体   中英

Multiple VS Projects in One Solution

I have a scenario that i have never come across and as such require help. I created an Visual Studio Web Application . The solution had two parts.

  1. Project that holds all the UIs and
  2. a Model that contain my c# code.

The objective was to achieve a 3 tier architecture. The model being the middle tier. The project is running and everything is awesome. NOW! This is my situation and I dont have an idea on how to approach it. I have to build another application, which basically is an extension of the first one. So how I went about starting this was to add another WEB Project to my currently solution. This had a lot of problem. When I deploy the project two web pages would load (one from each project). What i want is ONE webpage to load and base on your userId it will send you to the appropriate location. What I also saw was the second web project i added needed it's own users. How it should be is.. one set of users each having specific access to the application (which ever part). I need input on how to go about getting this done.

What I want is to debug 1 solution (with the 2 parts/projects ). Base on userId he/she has access to a specific project but there is one user list that governs the entire solution and not two list, one for each project.

Is there a problem just adding pages to a directory in the existing web project? Normally, separate projects would be deployed as separate applications, not as merged into the same application. You can control access using web.config files in the "secured" directories

Another Architectural suggestion would be to create a Main web project that was sort of a wrapper if these applications are extensive enough and functionally dissimilar enough to warrant separate projects. This would be where your routing logic would take place and would provide simple stub directories for your paths (user-type 1 ... user-type n). Then you can create a project for each of your end paths and set some build actions that take the output of the sub projects and copy them to the output directories for the wrapper project, but this gets pretty complex.

I would still recommend keeping this as a single project if it is to be deployed as a single web application.

While it's possible to make this work as two separate systems, it's really a lot more headache than it's worth in most cases.

The question you should ask yourself is, is it really worth it to do this? What are you gaining from it?

This article explains how to do this:

http://support.microsoft.com/kb/307467

Another option is to create sub-sites, which is to add your additional project as a child. This is described here:

http://abhighag.blogspot.com/2012/03/separate-web-application-into-multiple.html

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