Using multiple web projects with different languages in Visual Studio

By : Mario
Source: Stackoverflow.com
Question!

I need to combine a VB web project and a C# web project and have them run alongside each other in the same web root. For instance, I need to be able to navigate to localhost:1234/vbProjPage.aspx and then redirect to localhost:1234/cSharpProjPage.aspx. Is this possible from within Visual Studio 2008?

I know you have the ability to create a web site and throw everything into the root, but it would be best in this scenario to keep each project separate from each other.

UPDATE: To answer Wes' question, it is possible but not desirable to change paths like that (/vb/vbPage.aspx & /cs/csPage.aspx)

UPDATE: Travis suggested using sub-web projects. This link explains how to do it but the solution involves putting a project inside of a project, that is exactly what I am trying to avoid. I need the projects physically separated.

By : Mario


Answers

you could use URL re-writting with a filter to look for "cs" or "vb" at the begining of each file and direct it to the appropriate directory.



Just out of curiosity, would changing your url paths be out of the question? Instead of 1234/vbpage and 1234/cspage how about something like 1234/vb/page and 1234/cs/page ? I know you said same web root, but I'm just curious :)

By : Wes P


You can do this using sub-web projects. This has been available in Visual Studio since 2005 and works with the Web Application Project style of web site. ScottGu has a great blog entry describing the process. You may face some interesting challenges getting pages to commingle in the same folder, but the sub-web project structure should still lend you some ideas.



This video can help you solving your question :)
By: admin