There is supported choices of runtime for building server-side applications with. NET:. NET Framework and. NET Core. Both share a lot of the same. NET platform, and you can share code across the. However, there is fundamental differences between the and your choice would depend on what do you want to accomplish. This article provides guidance is on when you use each.
should use the. 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 in. NET versions by application.
should use the. NET Framework for your server application when:
- Your application currently uses. NET Framework (recommendation is to extend instead of migrating)
- You need the third-party. NET libraries or NuGet packages not available for. NET Core.
- You need the. NET technologies that is not available for. NET Core.
- You need to use a platform this doesn ' t support. NET Core.
1
When to choose. NET Core
The following is a and detailed explanation of the previously-stated reasons for picking. NET Core.
Cross-platform needs
Clearly, if your goal is to a application (Web/service) that should being able to run across platforms (Windows, Linux and MacOS), the best choice. NET Core.
. NET Core also supports the previously-mentioned operating systems as your development workstation. Visual Studio provides an Integrated development environment (IDE) for Windows. You can also with Visual Studio Code on MacOS, Linux and Windows which fully support. NET Core, including IntelliSense and Debugging. You can also target. NET Core with more third-party editors like Sublime, Emacs, VI and can get editor IntelliSense using The open source Omnisharp project. You can also avoid any code editor and directly with the. NET Core command-line tools, available for all supported platform S.
MicroServices Architecture
. NET Core is candidate if embracing a microservices oriented system composed of multiple independent, dyn Amically scalable, stateful or stateless microservices. . NET Core is lightweight and its API surface can minimized to the scope of the Microservice. A microservices architecture also allows you to mix technologies across a service boundary, enabling a gradual embrace of . NET Core for new microservices This live in conjunction with other microservices or services developed with. NET Framewor K, Java, Ruby, or other monolithic technologies. 2
The infrastructure platforms you could use is many. For large and complex microservice systems, you can use Azure Service Fabric. For stateless microservices You can also use the other products like Azure App Service. MicroServices alternatives based on Docker also fit any kind of microservices approach, as explained next. All these platforms support. NET Core and make them ideal for hosting your microservices.
Containers
Containers is commonly used in conjunction with a microservices architecture, although they can also BES used to container Ize Web apps or services which follow any architectural pattern. You'll be able to use the. NET Framework for Windows containers, but the modularity and lightweight nature of. NET Core Makes it perfect for containers. When creating and deploying a container, the size of their image is far smaller with. NET Core than with. NET Framework. Because It is cross-platform, you can deploy the server apps to Linux Docker containers, for example.
You can then host your Docker containers in your own Linux or Windows infrastructure, or use a cloud service such as Azure Container Service which can manage, orchestrate and scale your container-based application in the cloud.
A need for high performance and scalable systems
When your system needs the best possible performance and scalability,. NET core and ASP. ASP. NET Core outperforms ASP. NET by a factor of ten, and it leads other popular industry technologies for MicroServices SUC H as Java Servlets, Go and node. js.
This is especially relevant for microservices architectures, where you could has hundreds of microservices running. With ASP. Able to run your system with a much lower number of Servers/vms, ultimately saving costs in INF Rastructure and hosting.
A need for side by side in. NET versions per application level
If you want to is able to the install applications with dependencies on different versions of frameworks in. NET, you need to Use. NET Core, which provides 100% side-by-side. Easy Side-by-side installation of different versions in. NET Core on the same machine allows your to has multiple services On the same server, each of the them on their own version of. NET Core, eliminating risks and saving money in application Upgra Des and IT operations. 1
When to choose. NET Framework
While. NET Core offers significant benefits for new applications and application patterns, the. NET Framework would continu E to being the natural choice for many existing scenarios and as such, it won ' t is replaced by. NET Core for all server appli Cations.
Current. NET Framework Applications
In the most cases, you won ' t need to migrate your existing applications to. NET Core. Instead, a recommended approach is-use. NET Core as you extend an existing application, such as writing a new web servi CE in ASP. 1
A need to use third-party. NET libraries or NuGet packages not available for. NET Core
Libraries is quickly embracing. NET Standard, which enables sharing code across all. NET flavors including. NET Core. With. NET Standard 2.0 this'll be even easier, as the. NET Core API surface would become significantly bigger and. NET Co Re applications can directly use existing. NET Framework libraries. This transition won ' t is immediate, though, so we recommend checking the specific libraries required by your application B Efore making a decision one or another.
A need to use. NET technologies not available for. NET Core
Some. NET Framework Technologies is not available in. NET Core. Some of them'll be available on later. NET Core releases, but others don ' t apply to the new application patterns Targete D by. NET Core and may never is available. The following list shows the most common technologies isn't found in. NET Core 1.0:1
ASP. Web Forms Applications:ASP.NET Web Forms are only available on the. NET Framework and so are cannot use ASP. /. NET Core for this scenario. Currently there is no plans to bring ASP. Web Forms to. NET Core.
ASP. NET Web pages Applications:ASP.NET Web pages included in ASP. NET Core 1.0, although it is planned to be inclu Ded in a future release as explained in the. NET Core Roadmap.
ASP. SignalR server/client implementation. At. NET Core 1.0 Release timeframe (June), ASP. SignalR is not available for ASP (neither client or serve R), although it is planned to being included in a future release as explained in the. NET Core Roadmap. Preview State was available at the Server-side and Client Library GitHub repositories.
WCF Services implementation. Even when there's a wcf-client library to consume WCF services from. NET Core, as of June, WCF server implementation IS-available on the. NET Framework. This scenario isn't part of the current plan for. NET Core But it's being considered for the future.
Workflow related services:windows Workflow Foundation (WF), Workflow Services (WCF + WF in a single service) and WCF Data Services (formerly known as "ADO Data Services") is only available on the. NET Framework and there is no plans to B Ring them to. NET Core.
Windows Presentation Foundation (WPF) and Windows FORMS:WPF and Windows Forms applications is only available on the. NET Framework. There is no plans to port them to. NET Core.
Language support:visual Basic and F # don ' t currently has tooling support. NET Core, but both'll be supported in Visual Studio and later versions of Visual Studio.
4
In addition to the official roadmap, there is other frameworks to being ported to. NET core-for a full list, take a look a T Corefx issues marked as Port-to-core. Please note the list doesn ' t represent a commitment from Microsoft to bring those the components to. NET Core-they is Simply capturing the desire from the community to doing so. That's being said, if you care about all of the components listed above, consider participating in the discussions on GitHub So, your voice can be heard. And if you think something are missing, please file a new issue in the Corefx repository.
A need to use a platform this doesn ' t support. NET Core
Some Microsoft or Third-party platforms don ' t support. NET Core. For example, some Azure services such as service fabric Stateful Reliable Services and service fabric Reliable Actors requ Ire. NET Framework. Some other services provide a SDK not yet available for consumption on. NET Core. This was a transitional circumstance, as all of the Azure services use. NET Core. In the meantime, you can always use the equivalent REST API instead of the client SDK.
Choosing between. NET Core and. NET Framework for server apps