Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I Have Multiple ASP.Net Web Sites in Same Solution?

I have a website out there that I seem to keep wanting to add totally new things to each year. So when I go to www.MySite.com it does essentially one thing. So when I have a new idea for what is technically a totally different site, I do not want to have to come up with and then purchase a new domain name and hosting plan. I see in my hosting companies control panel that I can have multiple "application starting points." I have also read a bit about URL Rewriting. Not to mention, there is the setting of Virtual Path which I found when researching (Running aspnet web site starts on parent directory)

So my desire would be to have perhaps on solution with many projects (Web Apps) under it:

MySite
  MySite Folder One
  MySite Folder Two
  MySite Bin
  ...
  NewIdea
    NewIdea Folder One
    NewIdea Folder Two
    NewIdea Bin (I suspect each project would of course have its own Bin folder)
    ...
  Another Idea
    Another Idea Folder One
    Another Idea Folder Two
    Another Idea Bin
    ...

I am fine with the users having to go to:

www.MySite.com
www.MySite.com/NewIdea
www.MySite.com/AnotherIdea

To get to each of these "sites" but technically each of them are totally independent and can change and be published separately as needed. Each has their own web.config of course.

Is this possible and how can I do it? I think I have all of the pieces, I just have not done nor tried it to know.

like image 349
Grandizer Avatar asked Jan 13 '23 14:01

Grandizer


2 Answers

There's no reason you can't create different applications under your web site in IIS and then deploy different ASP.NET projects to the different applications. The different applications under your site can have different application pools, so you have that degree of isolation.

By default, your users would navigate to your different apps via:

  • MySite
  • MySite/App1
  • MySite/App2

This is probably what you're looking to do. Just create Applications (right click on your site in IIS and select "Add Application...") and then tweak as necessary.

like image 122
David Hoerster Avatar answered Jan 16 '23 03:01

David Hoerster


Right click on the solution, click 'Set Startup Projects', and click the 'Start Multiple Projects' settings. Change the action for each project to whether you want to start, start with debugging or not start.

like image 24
gspatel Avatar answered Jan 16 '23 02:01

gspatel