问题
I am about to maintain an old Web application that has WebForms projects. I need to add a new project to the application. Can it in any way be an MVC Core project? I mean, can an MVC Core project co-exist in the same application with WebForms projects?
回答1:
ASP.NET Core does not support WebForms and the Microsoft Team has said they have no plans to port webforms to asp.net core. So no, you can't make an old webforms project into a asp.net core project.
回答2:
If you are hosting your Web Forms application in Internet Information Services (IIS) you can create a separate project for MVC Core stuff and achieve the effect of hiving one application by adding the MVC Core application as a sub application in IIS Manager.
- Open IIS Manager
- Right click the Web Forms site and select "Add Application..."
- Select the folder you published your Core MVC application to as the "Physical path".
- In the alias, enter the base path you want to use for the MVC stuff.
来源:https://stackoverflow.com/questions/49799110/using-net-core-project-with-web-forms-projects