简体   繁体   中英

Can a .NET Core app, self hosting razor web app on Kestrel, run on full .NET and reference system.web?

This thought process started in this post .

What we are doing:

  • Converting a large asp.net app to razor (several hundred pages and templates)

    -- this part is done

What we want to do next: Self host the web site in kestrel

The question: This app uses a LOT of third party libs that require full .NET Framework on windows, including lots of references to system.web.

In a comment on this post , it is indicated that we can have a .NET Core project run on full .NET Framework.

If that is true, can this .NET Core project, which will self host using kestrel, also include full, "old" .NET 4.6 assemblies that use system.web?

In a comment on this post, it is indicated that we can have a .NET Core project run on full .NET Framework.

This idea is wrong and I am not sure which comment made you think of this. Either it is .NET Core or it is .NET Framework. You can host ASP.NET Core on .NET Framework or .NET Core, but that's another story.

If that is true, can this .NET Core project, which will self host using kestrel, also include full, "old" .NET 4.6 assemblies that use system.web?

No, you cannot, since that is not true. You can , however, have an ASP.NET Core application running on .NET Framework 4.6 that uses System.Web references, but this has many limits; for example, you cannot run ASP.NET OWIN pipelines on ASP.NET Core. It all depends on what specifically you need to use from System.Web and its related assemblies.


However, let me make this as clear as possible:

.NET Core != ASP.NET Core

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM