1

I have our legacy ASP.NET web forms application. I need to create new pages and I want to use the APS.NET Core MVC project for those new pages. Is this possible? How It can be done?

Just to add, I don't need to keep the state b/w pages from both projects.

I tried to create a separate MVC core project (under the same solution) but can't figure out how to do the routing between them.

Edit: I know this is possible by using MVC .NET Framework. My question is specific to MVC Core.

3
  • Does this answer your question? How to enable MVC in a WebForms project? Commented Jan 26, 2021 at 19:42
  • Granted, you might not be able to add MVC core, as WebForms is .Net Framework. Commented Jan 26, 2021 at 19:43
  • @gunr2171 yes, this is what I'm tyring to confirm and figure it out. Your link is related to MVC Framework and will not help me. Commented Jan 26, 2021 at 19:45

1 Answer 1

4

No, you can not. While the objects used by the request pipeline seem very similar between the Asp.Net and Asp.Net Core, they are in fact totally different objects which come from totally different namespaces. The two are totally different pipelines that don't interact in any way. So at the end of the day it's either going to be one pipeline listening for incoming web requests or it's gonna be the other. You can't have both trying to process the web request for your web application.

By way of contrast, in the Asp.Net when using the Full framework you can have Web Forms and MVC both coexist no problem. This is because both use the same request pipeline that lives in the System.Web namespace. So while the way they respond to the request might be a bit different, they both use the same HttpContext object. This is not true of Asp.Net Core. It uses a totally different HttpContext object located in the Microsoft.AspNetCore.Http namespace.

You may also find my answer for this question informative: Is it at all possible to migrate ASP.NET ASPX solution to ASP.NET Core 2.0?

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

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.