How the. NET Core vs. NET Framework chooses a runtime for an application

Source: Internet
Author: User
Tags unsupported

is. Net core the next big thing? I have been using it for some time, and I tend to think it is. In fact, we speculate that in the 2018, there will be a huge demand for this skilled developer. But what is the difference between it and the. Net framework? What you need to know to use them effectively. In this article, we will explain the main differences and how to ensure the best use of them.

Previously, the. Net framework only worked on window devices. The Xamarin and Mono project is dedicated to porting. NET to mobile devices, MacOS, and Linux. NET core provides a standard set of basic libraries that can be used by Windows, Linux, MacOS, and mobile devices.

. Net consists of the following four parts:

    • Common Language Specification (CLS): It defines how an object is implemented, so it can work anywhere because it is independent of the system platform. The CLS is a subset of the CTS (Common type System), which sets a common method for describing the type.
    • Framework class Library (FCL): A standard library for mobile phone reusable classes, interfaces, and value types.
    • Common language Runtime (CLR): is to run the framework and manage it. NET program to execute the virtual machine.
    • Tools like VisualStudio to create stand-alone applications, interactive Web sites, Web applications, and Web services.
. NET Core vs. NET Framework

Microsoft maintains two runtimes, and they have many of the same APIs. This shared API is known as. Net stand.

Developers use the. Net framework to create Windows desktop apps and basic service apps. It contains an ASP. Net core that is used to create a service app so it can run on Windows, Linux, and Macs. It does not currently support the creation of desktop apps. Developers can write programs in two runs using, C #, and F #. C # is an object-oriented language. For people working in C and their similar languages, the learning curve should not be a problem. F # is a cross-platform language and also an object-oriented language. Visual Basic is available in the. NET Framework and has limited support for. NET Core2.0.

Developers should choose. Net Core for the following scenarios:

. Net core is a cross-platform and open-source framework that can be developed on any platform. Typically it is used in cloud applications or refactoring large enterprise applications into microservices. So when should I use it?

1, the project needs cross-platform

When an application needs to run on multiple platforms like Windows, Linux, and MacOS use. These operating systems have been supported as development stations (supported operating systems are growing).

    • VS can be used on Windows and use the new restricted version on MacOS.
    • VS code can be used on Windows, Linux, and MacOS.
    • The command line is used on all supported platforms.
2. When using Docker containers

Containers and microservices architectures are often used together. Because it is lightweight and modular,. Net core works well in containers. Server apps can be deployed across platforms into Docker containers. The. Net framework can also use containers, but the mirrors are too large.

3, if there is a high performance and scalable system needs

Microsoft recommends the use of. Net Core and asp: to get the highest performance and scalability. As hundreds of microservices are used, this becomes very important. A smaller number of servers and virtual machines should be required. The efficiency and scalability gained can be translated into a better user experience in addition to cost savings.

4. If you run multiple. Net versions at the same time

To be in. NET, developers need to use. NET Core for applications that install dependencies in different versions of the framework. You can use different versions of the. NET runs multiple services on the same server.

5. If you want to develop with the command line

Some developers prefer to work with lightweight editors and command lines.. Net core has a command-line interface that already supports all platforms. It requires minimal installation on the production machine.

The following conditions are not appropriate for use with. Net Core

There is a problem:. NET core does not yet fully support. NET libraries and outreach. In some cases, it may not be the best choice at the moment, but as it continues to evolve, it may eventually apply to most use cases. Consider the following scenarios:

1. Windows forms and WPF programs

is not supported. You have to use Mont to create a. Net desktop application for MacOS.

2. ASP. NET WebForms does not exist

Microsoft has plans to implement it in ASP.

3. You need to create a WCF service.

. Net core does not now support WCF. Instead, you need to use ASP. NET Core MVC to create the rest API.

4, third-party library support

. NET Core2.0 provides compatibility with the. NET Framework and. NET Core. However, there is still a compatibility issue where the class library is not implemented. Nonetheless, this will help connect many class libraries to. Net Core.

5. Lack of. Net Framework Features

Some. NET Framework features are not in. NET Core. For example, EF core is different from EF V6.

6. You need access to specific Windows APIs

If your program needs access to the registry, WMI, or other window APIs, it won't work.. Net core is designed to be system agnostic.

7. Partial support for and F #

Microsoft and the community have continued to update, but not all of them have been supported.

8, SINGALR is not supported

It is planned to be supported in. Net Core2.1.

Developers should use the. Net Framework in the following scenarios

It can be used with Docker and window containers, and it is possible to use it.

The. Net Framework project is already in use.

Instead of migrating and replacing applications. For example, developers can write a new Web service with ASP. NET Core.

A third-party class library or NuGet package is used in a. NET Framework project but is not available in. NET Core.

. NET core is being widely used, and if you work with the. NET Framework class library that is not compatible in. NET core, you still need to use the. NET Framework. NuGet is the free and open source Package Manager for. NET and other Microsoft development platforms.

Projects that are in development are not yet available in. Net Core

    • . NET core does not yet fully support the. NET Framework technology. These include:
    • ASP. NET Web Forms application
    • ASP. NET Web pages application
    • ASP. SignalR Server/Client
    • WCF Services
    • Workflow-related services
    • WPF and Windows Form
Some platforms do not yet support. NET core when not using the. NET Framework

The following scenarios should not use the. Net Framework:

    • Projects need to be used on multiple platforms.
    • Requires high performance and scalability.
    • Projects must use an open source framework
How to migrate from the. NET Framework to. NET core 1, analyze third-party dependencies

It's not just about knowing what a third-party dependency is. If you're running a program on. Net core, how you should rely on those third-party dependencies, and if they don't run, need to know what the application needs to do.

The NuGet package is easy to check because it usually has a description dependency on the NuGet site, and the package has a set of folders for each platform. You can also view the dependencies on the page for the package, and then look for a folder or entry with any of the following names.

If the dependency is not a nuget package, the Apiport tool can check the portability of the dependencies.

New features for use with. NET Core 2.0, compatibility can reference. NET Framework packages that have not yet been converted to use. NET Standard. Be sure to test these packages thoroughly, because they may still be problematic if they use an unsupported API.

2, the target of the standard library

. NET Standard library is intended for all. NET runtimes, locating the. NET Standard library is the best way to build a cross-platform class library.

There are eight platforms that can provide multiple versions to varying degrees. If the target version of the project is low, you cannot reference a project that is targeted at a higher version. Select the lowest used in all projects. NET Standard Version. Here are each. NET Standard version of the chart, showing the specific areas they run:

3. Re-adjust the project

All projects to be migrated need to be targeted to the. NET Framework 4.6.2. This will ensure that API alternatives for the. NET framework-specific targets are available for unsupported APIs. This makes it easy to complete and recompile these projects with the Target Framework command in Visual Studio.

Article translation from. NET Core vs. NET Framework:how to Pick a. NET Runtime for a application

How the. NET Core vs. NET Framework chooses a runtime for an application

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.