Difference between using the ASP.NET Core Web Application (.NET Core) with net461 set as the only framework and using the (.NET Framework) template

Blake Rivell :

With the release of .NET Core RC2 Microsoft made it so there are now 3 Web Application templates:

  • ASP.NET Web Application (.NET Framework) — The old
  • ASP.NET Core Web Application (.NET Framework) — the new, to be hosting on Windows only
  • ASP.NET Core Web Application (.NET Core) — Linux, OSX, Windows

I am trying to use the new Core Web Application template but without trying to target Linux, OSX, Windows so it seems like the ASP.NET Core Web Application (.NET Framework) is perfect for me. It took me a while but I learned that in order to add a class library that will work with this project type you need to add a Class Library (.NET Core) and change the frameworks section to only be net461 to match the Web Application.

"frameworks": {
    "net461": { }
}

My Question:

What is the difference between creating a ASP.NET Core Web Application (.NET Core) and in project.json making net461 the only target framework

and

just creating a ASP.NET Core Web Application (.NET Framework) project which only includes net461 by default.

Are there other difference that I am not aware of like the way the the projects are published, etc.?

devfric :

What is the difference between creating a ASP.NET Core Web Application (.NET Core) and in project.json making.NET461 the only target Framework

It's the same thing as making an ASP.NET Core Web Application (.NET Framework) project. The type of project between the two is determined by the .csproj file and you changed it in your .csproj from targeting .NET Core to targeting the .NET Framework. In previous release/beta versions of ASP.NET Core it was possible to have both Frameworks in a project.json file (which has been replaced by a simplified .csproj file in .NET Core 2.0 which more .NET developers are familiar with) but you could only publish to one.

just creating a ASP.NET Core Web Application (.NET Framework) project which only includes.NET461 by default.

Are there other difference that I am not aware of like the way the the projects are published, etc If you target the .NET Framework and not .NET Core your app cannot be cross platform and your app can only run on Windows and not Linux/Mac.

The reason for there being separate ASP.NET Core Web Application (.NET Core) and ASP.NET Core Web Application (.NET Framework) is because the latter allows you to make use of functions, packages or 3rd party libraries that are dependent on Windows and the same .NET Framework or higher will be required to be installed on the machine.

The former doesn't have the .NET Framework requirement but allows your app to be cross platform and when you publish your app it publishes all the dependent .NET Core dll files to the publish directory in that way circumventing the .NET Framework installation requirement.

It will also affect compilation as if you target .NET Core and make use of a Windows specific function or package you will get a compilation error.

You can easily switch between the two by adjusting your .csproj to target the one or the other.

Microsoft Docs

You should use .NET Core for your server application when:

  • You have cross-platform needs.

  • You are targeting microservices.

  • You are using Docker containers.

  • You need high performance and scalable systems.

  • You need side by side of .NET versions by application.

You should use .NET Framework for your server application when:

  • Your application currently uses .NET Framework (recommendation is to extend instead of migrating)
  • You need to use third-party .NET libraries or NuGet packages not available for .NET Core.
  • You need to use .NET technologies that are not available for .NET Core.
  • You need to use a platform that doesn’t support .NET Core.

Update (2018/10/30)

It has been announced that ASP.Net Core 3 which has a release date in 2019 Q1, will only support .NET Core and NOT .NET Framework

As announced on the .NET Blog earlier this month, .NET Framework will get fewer of the newer platform and language features that come to .NET Core moving forward, due to the in-place update nature of .NET Framework and the desire to limit changes there that might break existing applications. To ensure ASP.NET Core can fully leverage the improvements coming to .NET Core moving forward, ASP.NET Core will only run on .NET Core starting from 3.0. Moving forward, you can simply think of ASP.NET Core as being part of .NET Core.

Customers utilizing ASP.NET Core on .NET Framework today can continue to do so in a fully supported fashion using the 2.1 LTS release. Support and servicing for 2.1 will continue until at least August 21, 2021 (3 years after its declaration as an LTS release) in accordance with the .NET Support Policy.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Difference between using the ASP.NET Core Web Application (.NET Core) with net461 set as the only framework and using the (.NET Framework) template

分類Dev

Problem scaffolding new controller using Entity Framework Core in ASP.NET Core 2.1 MVC

分類Dev

How to load a .NET Core assembly from an application written in .NET Framework?

分類Dev

Use full .NET Framework with existing ASP.NET Core project

分類Dev

Class library that can be shared between .NET Framework and .NET Core

分類Dev

AKKA.NET configuration using .NET Core for framework net46

分類Dev

How to configure hangfire in asp.net core using structuremap targeting .net framework and resolve bi-directional dependency

分類Dev

Update model with TryUpdateModel in ASP.NET MVC Core Web API and Entity Framework Core doesn't work

分類Dev

.NET Framework to .Net Core skillset transfer

分類Dev

Using BeginCollectionItem in ASP.net Core

分類Dev

Using LXD REST API, ClientWebSocket throws 'AuthenticationException' on .Net Core, but on .Net Framework, it works well

分類Dev

Using .NET Core library in .NET 4.5.2 console application

分類Dev

Array of string is null ASP.NET Core Entity Framework

分類Dev

.NET Framework 4.6、.Net Native、.Net Coreの違い

分類Dev

What is difference between View and Page in Asp.net core 2?

分類Dev

ASP.NET Core Webアプリケーション(.NET Framework)TagHelper Intellisense

分類Dev

Plans to support .NET Core in Bot Framework SDK?

分類Dev

Entity Framework Database First .Net Core

分類Dev

Net Core: Entity Framework ThenInclude with Projection Select

分類Dev

ASP.NET Webアプリケーション(.NET Framework)とASP.NET Core Webアプリケーション(.NET Framework)

分類Dev

ASP.NET Webアプリケーション(.NET Framework)とASP.NET Core Webアプリケーション(.NET Framework)

分類Dev

ASP.NET Coreで完全な.NET Frameworkを使用する理由

分類Dev

ASP.NET Coreで完全な.NET Frameworkを使用する理由

分類Dev

ASP.NET Coreで完全な.NET Frameworkを使用する理由

分類Dev

Is it possible to reference .net framework 4.7.2 class library from an ASP.NET Core MVC project?

分類Dev

Using Azure Active Directory authentication in ASP.NET Core 2.0 from Web App to Web API

分類Dev

How do I reference a .NET Framework project in a .NET Core project?

分類Dev

How do I reference a .NET Framework project in a .NET Core project?

分類Dev

How do I reference a .NET Framework project in a .NET Core project?

Related 関連記事

  1. 1

    Difference between using the ASP.NET Core Web Application (.NET Core) with net461 set as the only framework and using the (.NET Framework) template

  2. 2

    Problem scaffolding new controller using Entity Framework Core in ASP.NET Core 2.1 MVC

  3. 3

    How to load a .NET Core assembly from an application written in .NET Framework?

  4. 4

    Use full .NET Framework with existing ASP.NET Core project

  5. 5

    Class library that can be shared between .NET Framework and .NET Core

  6. 6

    AKKA.NET configuration using .NET Core for framework net46

  7. 7

    How to configure hangfire in asp.net core using structuremap targeting .net framework and resolve bi-directional dependency

  8. 8

    Update model with TryUpdateModel in ASP.NET MVC Core Web API and Entity Framework Core doesn't work

  9. 9

    .NET Framework to .Net Core skillset transfer

  10. 10

    Using BeginCollectionItem in ASP.net Core

  11. 11

    Using LXD REST API, ClientWebSocket throws 'AuthenticationException' on .Net Core, but on .Net Framework, it works well

  12. 12

    Using .NET Core library in .NET 4.5.2 console application

  13. 13

    Array of string is null ASP.NET Core Entity Framework

  14. 14

    .NET Framework 4.6、.Net Native、.Net Coreの違い

  15. 15

    What is difference between View and Page in Asp.net core 2?

  16. 16

    ASP.NET Core Webアプリケーション(.NET Framework)TagHelper Intellisense

  17. 17

    Plans to support .NET Core in Bot Framework SDK?

  18. 18

    Entity Framework Database First .Net Core

  19. 19

    Net Core: Entity Framework ThenInclude with Projection Select

  20. 20

    ASP.NET Webアプリケーション(.NET Framework)とASP.NET Core Webアプリケーション(.NET Framework)

  21. 21

    ASP.NET Webアプリケーション(.NET Framework)とASP.NET Core Webアプリケーション(.NET Framework)

  22. 22

    ASP.NET Coreで完全な.NET Frameworkを使用する理由

  23. 23

    ASP.NET Coreで完全な.NET Frameworkを使用する理由

  24. 24

    ASP.NET Coreで完全な.NET Frameworkを使用する理由

  25. 25

    Is it possible to reference .net framework 4.7.2 class library from an ASP.NET Core MVC project?

  26. 26

    Using Azure Active Directory authentication in ASP.NET Core 2.0 from Web App to Web API

  27. 27

    How do I reference a .NET Framework project in a .NET Core project?

  28. 28

    How do I reference a .NET Framework project in a .NET Core project?

  29. 29

    How do I reference a .NET Framework project in a .NET Core project?

ホットタグ

アーカイブ