0

I have an old web forms application (.net 3.5) hosted at www.business-app.local

I want to build a new ASP.NET MVC (.net 4.0/4.5) application that will also have the domain name www.business-app.local

I know I can't have two applications with the same domain and port on IIS. I have tried adding the MVC app in a virtual directory but hit a bunch of web.config clashes.

I want to keep the two applications separate, i.e. it is not a solution to just add the web forms pages to my MVC application, or to add MVC to the web forms application.

How can I achieve this using IIS 8?

3 Answers 3

1

The easiest way to do this is to create your new MVC app and add the folders containing the webforms into it. Queti mentions doing this the other way around, but honestly, it's a massive PITA, as you have to hack around with config files and references.

Once you have your webforms pages in specific folders in the MVC app, simply add exclusions for them from routing in global.asax.cs like so:

routes.IgnoreRoute("Webformsfolder/{*pathInfo}")

Also, seeing as you are (I presume) phasing out the webforms stuff eventually, it's probably best to start from scratch anyway, IMHO. Good luck!

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the reply, but as I said in the question I want to keep the applications separate
Then sub-domains would be the route I took. Ability to share cookies and more etc.
I want to keep them on the same domain
0

You could add MVC to the current application. The trick is to make sure that the routes do not conflict with the web forms directories otherwise the WebForms will be the ones that handle the request.

This is the process I've followed when migrating Web Forms sites to MVC.

1 Comment

Thanks for the reply, but as I said in the question I want to keep the applications separate.
0

I have had to compromise and put them two apps on separate sub domains with a common cookie.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.