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:

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?

Upvotes: 3

Views: 967

Answers (1)

Camilo Terevinto
Camilo Terevinto

Reputation: 32068

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

Upvotes: 3

Related Questions