views:

33

answers:

2

I have a Visual Studio solution containing two web applications.

I would like the first to depend on the second (pages in the first may contain links to, or possibly post to pages in the second).

Furthermore, I would like to be able to launch the first project on a development server (standard debugging procedure for web apps in VS) and have the references to the second project be fully functional.

Does anyone know the best way to achieve this?

Thanks.

+1  A: 

You can establish the dependency relationship by right clicking on your top-level web application project and selecting Project Dependencies. Check the dependency web application project in the list. To start both projects for debugging, follow these steps:

  1. Right click on the solution and select Properties.
  2. Select Common Properties > Startup Project from the list on the left.
  3. Select the Multiple startup projects option
  4. Set the Action column appropriately for your projects and click OK

When you start the debugger, your projects should startup as desired.

Jim Lamb
Thanks, all of this works as you describe. However, when I debug, I still cannot get the links in the top-level project to refer to a valid instance of the dependency project. Any thoughts?
mcoolbeth
What problem are you hitting with the links? Are you running your web applications in the development server? Is it picking a random port?
Jim Lamb
Correct - and I can't seem to get two projects to host simultaneously on the same port.
mcoolbeth
A: 

not entirely sure what you mean by "depend on second" but i am guessing that you want to share some code between them and than step through that code while debugging?

why not extract all common code into common re-usable assemblies? That will make it easy to debug regardless which application is running.

Sonic Soul