Why choose. NET Core?

Source: Internet
Author: User
Tags benchmark microsoft download center

why Choose. Netcore?

Learning a new development framework is a huge investment. You need to learn how to write, build, test, deploy, and maintain applications in a new framework. As a developer, there are many frameworks to choose from, and it's hard to know what's best for you. Even if you are using. NET development software, and. NET core is not the same, you need to take the time to learn the tools and technologies that use it. To understand why. NET core is worth seeing, it helps to know where you start.

. Netcore's Open Source protocol

. NET core belongs to the. NET Foundation and is officially supported by Microsoft. Using the most liberal MIT and Apache 2 Open source Protocol, document protocols follow cc-by. This will allow any person to dispose of any organization and business, including using, copying, modifying, merging, publishing, distributing, re-authorizing, or selling. The only limitation is that the above copyright and licensing notice must be included in the software and that the agreement will be licensed in addition to the copyright of the user, and that the license is free, non-exclusive (authorized by any person and business) and is permanently irrevocable, Microsoft has the utmost sincerity compared to Oracle's open source agreement with Java and MySQL

if you are a. NET Framework developer

. NET core is an opportunity to re-launch some of the framework components and provide cross-platform work for others. Because the. NET Framework is primarily built on managed (C #) code, these parts do not need to change code to move to. NET Core. Libraries that rely on Windows-specific components must be removed or refactored to use cross-platform alternatives. The same applies to your application.

your. NET applications can be cross-platform

Your existing. NET Framework applications can work on other operating systems. This is a good choice for developers who want to expand the class library's audience platform, or who want to use the same code in other areas of the distributed application. Even if you want to develop. NET on your shiny blind MacBook, without having to double boot to Windows.

Not all frameworks are ported to. NET Core, but the main part. There are some API differences. For example, if you use a lot of reflection, you might need to refactor your code to use the core. For more information, see the Difference section at the end of the article.

asp.netcore than framework ASP .

the performance differences between ASP. NET core and ASP. NET are several orders of magnitude. The majority of ASP. NET is limited by the traditional system.web library. The. NET Framework supports an older version of the ASP, and this constraint restricts the development of ASP. Microsoft decided to rewrite the entire architecture. This means breaking the change, but the result is worth it.

. Netcore is the focus of innovation

Backwards compatibility is a double-edged sword. This means that your application can continue to be supported by the new version framework, ensuring that changes made in the new version framework do not break existing applications.

All efforts to avoid change have limited the innovation of the framework. The framework changes require thorough justification (usually from the customer), exhaustive testing, and approval from multiple tiers of product groups.

With. NET core, teams can more easily focus on. NET core work. For example, changes to the core class libraries (such as system.collections) still need to be as dynamic as the. NET Framework, but the virtual core or entity Framework Core makes it easier to make substantial changes and is not subject to backward compatibility restrictions. This allows for greater innovation.

The. NET framework is released as a whole product, however. Netcore are broken down into multiple parts. Now developers can choose which version of the library to use. as long as it's in. NET Standard library, the. NET core team can innovate with less difficulty . That's why in the future you'll only see the bug fix framework;. NET core will get all the new features.

Faster Release Cycles

If you have encountered an error in the framework and reported it to Microsoft, you will know how long it will take to release the repair. This framework has a long release cycle, usually at least one year, and there are small windows for feature work in these cycles. Each code change can cause unexpected problems elsewhere in the framework. In order to give each team enough time to test the framework, there are many times when code changes are restricted or strictly censored. If you are in. NET found an error, it is best to find a workaround instead of waiting for the update (which is also. Netcore the benefits of open source, you do not need to rely entirely on Microsoft support to solve the problem, which is advantageous for large enterprises, can use technical resources to. Netcore for the enterprise customization, become. Netcore Branch to run).

. NET core follows a faster release pace. Developers can use nightly builds to test early. does not belong to. The Library of the Net standard library can be published at its own pace. because everything is open source, if Microsoft does not respond quickly enough, any developer can make patches. If the solution is not accepted, the discussion will be made public and everyone can see why the decision was made.

if you are. NET Novice

On the Windows platform,. NET Framework is not much of a competition. Microsoft can be from the OS kernel layer to advanced. NET Library to make changes to all content. by the. NET introduces other platforms, the competitive environment has changed. NET must now compete with all other development frameworks.

C # is a great language.

. NET's flagship language C # has many unique features, such as language-integrated queries and asynchronous constructs, making it powerful and easy to use. Compared to conservative Java (we also see that Oracle's old Java has become increasingly difficult to introduce new features, which is a historical burden, the future of modular development is difficult to update maintenance) C # is also constantly innovating. The C # team exposes the design language because they want anyone to make suggestions or participate in discussions. The compiler (Roslyn) is completely modular and extensible.

ASP. NET core performance comparable to the top-level Web platform

If you are writing a Web application or service, then ASP. NET core is a good platform to build. It has excellent performance and low memory footprint. Many features make your application easier to develop and maintain.

. NET core does not start from scratch

. NET was there before 2000. The framework code has been consolidated over the past few years, and developers have benefited from it. most of the framework code that has been ported to the core has not changed. This enables. NET core to be a step ahead in building a reliable framework for your application .. NET core is also fully supported by Microsoft and has an increasingly active open source community such as Red Hat organization. This reduces the risk of using core for your application.

what is. Netcore?

To understand. NET Core, it helps to understand the. NET Framework. Microsoft released the. NET Framework at the beginning of 21st century, a Windows-only development framework that provides memory management, security, exception handling, and many other features at the very bottom. NET Framework comes with a large stack of libraries that can perform various functions from XML parsing to HTTP requests. It also supports several languages and compiles them into the same generic intermediate language; Any language can use libraries built in any other language. These key concepts also appear in. NET Core.

In 2016, Microsoft acquired Xamarin and released. NET Core 1.0. Previously, Xamarin had migrated most of the. NET Framework to run on Linux/unix-based operating systems. Some code can be shared between. NET Framework,xamarin and the new. NET core, but the compiled binaries cannot. Part of the. NET core effort is to create a standardized platform that allows all. NET implementation to share the same library.

                          

Figure 1 . NET Framework,. NET core and Xamarin share a standardized platform called the. NET Standard library

A binary file cannot be shared between the previous Xamarin and the. NET Framework. With. NET Standard library and the introduction of a common infrastructure, the two frameworks are now unified. NET ecosystem.

What is. Netcore? In, it seems that. NET core is another framework that contains the UWP (universal Windows Platform) and ASP. To make. NET core a reality, create a. NET Standard libraries and common infrastructure.

. Key features of the Netcore

The. NET core draws on best practices from the. NET Framework and combines the latest advances in software engineering. These are some of the notable features of. NET Core.

Expand the reach of your class library

With. NET Core, you can use the. NET standard library to write applications or libraries.

It can then be shared on many platforms.

Figure 2 . Netcore Development

The same library can run in the background service "on-premises" or in the cloud, or in a client application running on a phone, tablet, or desktop. Instead of building separate applications for ios,android and windows, you can build an application for all platforms.. NET core is a small and perfect container that can easily scale and shorten development time.

The. NET core and. NET Standard libraries set up a common platform. In the past, developers had a responsibility to rebuild applications or libraries for new platforms and distribute updates when new versions of the operating system or new devices appeared. With. NET Core, you do not need to rebuild and redistribute. As long as the new platform supports all of your dependent libraries, it supports your application.

simple deployment on any platform

Microsoft products tend to have complex installation procedures. COM components, registry keys, special folders, GAC-are designed to take advantage of the features of Windows: NET Framework relies on these constructs, which makes it unsuitable for other operating systems.

When you publish an application that relies on the. NET framework, the installation process?? The sequence must be smart enough to detect if the wrong. NET Framework version is installed and provide the correct method for the user. Most modern versions of Windows contain the. NET Framework. This makes it easier for some applications to install, but if your application uses features that are not installed by default, such as the integration of ASP. NET with IIS or WCF components, it can cause complex problems.

Another complex problem comes from patches. Hotfixes that include bug fixes or security updates can be distributed to customers through Windows Update or through the Microsoft Download Center. The. NET framework for your test application may be different from the patches that customers use. When you assume that the. NET framework is the same for all customers, it is often difficult to determine the cause of strange behavior in the application.

The modular design of. NET core means that you only include the dependencies you need. All of these dependencies go into the same folder as your application. Deploying an application is as simple as copying a folder. Another advantage of this approach is that multiple versions can be run in parallel. This strategy is essential for keeping the deployment experience of all platforms consistent.

Cloud and Containers

In a cloud system, it is important to provide services to a higher-density user with less hardware. The smaller the footprint of the application, the higher the density. Virtual machines have been ubiquitous in the cloud for years, but they have several problems:

    • Size-A typical virtual machine file is gigabytes, if not a few 10,000 megabytes. This makes them very time-consuming to transmit across the network, and requires a lot of disk space.
    • Startup time-Starting the virtual machine means starting the operating system. For Windows, this is a challenge because it takes time to start a new machine. This can make it difficult to deal with sudden traffic.
    • Memory-the virtual machine needs to load the entire operating system into memory along with the application. This means that many of the host's memory is wasted.
    • Inconsistencies-the same virtual machine can replicate to multiple hosts, and the host must provide the same virtualized hardware, which may depend on the physical hardware. There is no guarantee that the virtual machine will run the same operation on any given host.

Containers solve virtual machine problems by virtualizing the operating system. The container contains only the application and its dependencies. The file size is many times smaller, and the startup time is in seconds, and only the application is loaded into memory, and the container is guaranteed to work on any host.

The. NET framework built into Windows cannot run on a container. Given the obvious advantages of containers,one of the design decisions of. NET core is to make it modular . It means your. The Netcore application can be "released" so that it and all its dependencies are in one place, which is easy to put into the container .

ASP. NET Performance

If you are unfamiliar with ASP. NET, the Web application platform is built into the. ASP. NET is used by many influential organizations, including stack overflow and the vast majority of highly reliable financial securities industry sectors. Asp. NET is the first version of the. NET Framework released in 2002 and continues to evolve. Despite the success of ASP, it was felt in the ASP. NET team that they are losing developers because ASP. NET performance is not competitive and can only run on Windows platforms.

A company called Techempower runs a benchmark for the Web application platform every few months and provides a ranking of several categories. The benchmark runs on Linux and contains only the Windows platform. This is a hassle for the ASP. Many platforms are used to write cross-platform Web applications, and their performance data is impressive. In addition, some Java frameworks have published astronomical figures, such as 5.7 million plaintext requests per second, or 4.9 million.

Figure 3 Techempower Benchmark, 12th round

In the 11th round of the Techempower benchmark, ASP. NET MVC on the Mono platform was included in the test. The result is not good. The ASP. NET on Mono produces a tiny 2000 plaintext request per second. Mono is not created by Microsoft, and it does not get the same amount of performance tuning as the normal. NET framework. In order to get a fairer comparison, ASP. NET team decides to run the benchmark test for. NET 4.6 on the same hardware as the techempower. The result is about 50,000 requests per second. Still not close to Nodejs (320,000 requests per second), or any other top-level frame on the Techempower list.

Poor low scores are no surprise. As mentioned earlier, ASP. NET knows that changing the status quo can only remove barriers by rewriting the entire architecture. That's exactly what's going on.

Asp. NET team to build ASP. A few months later, the team celebrated the more than 1 million requests per second of ASP. The performance of the latest Asp.netcore and node. JS is further enhanced by the performance benefits of ASP.

ASP. NET Core VS node. js

You can see that the performance of ASP. NET core as a complex web development has improved compared to the previous quality, asp .

The ASP. NET core demonstrates the shift in Microsoft thinking. Microsoft realizes that it has to be competitive to win developers. It must also compete on a platform other than Windows. This is the driving force behind creating. NET core.

Open Source

Modern software developers are not content to seek functionality. This is especially true when there is already an open source project that meets their needs. When big companies are keen on open source software, even the most loyal Microsoft developers will turn to other frameworks and libraries to complete their projects on time and on budget. If Microsoft cares about "developers, they have to make changes."

Exposing the source code for the. NET Framework is the first step. The. NET Framework sources have been exposed for years on referencesource.microsoft.com and GitHub.

Figure 4 . NET Framework Reference Source

From separate open source code to accepting foreign contributions is completely different.. NET core developers not only want to gain external contributions, they also want to incorporate the community into design and development. This has led to more transparency. the ASP. NET core team will be here every week a community Live Meeting was held on http://live.asp.net . The code for. NET core is publicly available on GitHub from the start, and anyone can make a request. Community members can create errors and features in GitHub.. NET core has marked a major shift in Microsoft's open source.

differences with the. NET Framework

. NET core is not just the. NET Framework for Linux and Macs. Microsoft has not ported all of the. NET Framework, and for ASP. ASP. NET core drivers. Both the Mvc,web API and the SIGNALR can be found in. NET core, or on the road map.

The framework functionality is not ported to. Netcore

I have given this list a change of knowledge. Some features are not available for non-Windows platforms, and some other features will not be introduced by Microsoft in the future because there are better replacements or features that are problematic in some ways (unsafe, difficult to maintain, etc.).

    • Wpf/xaml-windows Presentation Foundation applies only to the user interface. NET Standard library does not include a user interface library, and. NET core does not provide a cross-platform UI framework. This means something like Windows Forms and systems. The drawing is not ported to. NET Core.
    • Transaction-This library makes it easy to create distributed transactions. It relies on Windows-specific components to make it difficult to migrate to. NET Core.
    • AppDomains-These are very useful for isolating assemblies and do not terminate processes, which is useful for applications that allow plug-ins. They depend on certain Windows-specific constructs that do not work on other operating systems.
    • . NET Remoting-The remote object has been successfully completed by the rest service.
    • ASMX-The old method of writing Web services that have been superseded by Web APIs.
    • Linq to SQL-replaced by the Entity Framework.
    • WCF Services-Windows Communication Foundation Client features are available in. NET core, but cannot create services.
    • The Wf-windows Workflow Foundation relies on transactions between XAML,WCF services and other. NET Framework features.
subtle changes for. NET Framework Developers

Experienced. NET Framework developers may experience some surprises in. NET Core. Writing new code should be relatively straightforward, because you are less likely to use HashTable an old structure like or ArrayList . Visual Studio IntelliSense also indicates whether. NET core supports types, methods, properties, and so on.

Figure 5 Visual Studio IntelliSense indicates whether a class or member is available in. NET Core

。 NET Portability Analyzer

If you try to put an existing. NET application to. NET Core, then the best place to be. NET Portability Analyzer. It can be used either as a command-line application or as a Visual Studio plug-in. There are many. NET platform to choose from:

Figure 6 . NET Portability Analyzer for the target platform

Use this tool whenever possible to create a detailed report that provides useful advice:

Figure 7: NET Portability Analyzer report

Reflection

Reflections in. NET core work differently than in the. NET Framework. The most obvious difference is that Type类 many operations on the normal are no longer present. Some people have been transferred to a new one TypeInfo类 . Other operations are in the. NET Standard library, and requires additional dependencies.

. NET Framework Implementation Reflection

  Null;  foreach (In this. Name && Property . Propertytype.isgenerictype) {     

The. NET Core implements Reflection.

Null;  foreach (inowningelement.gettype (). GetProperties ()) {this. Name && Property . Propertytype.gettypeinfo (). Isgenerictype) {     

? need to rely on System.Reflection.TypeExtensions

? Many types of operations moved to the TypeInfo

Overview

The software development industry is constantly evolving. From language to framework, tools and methodologies, everything is challenged and improved. NET Framework has come to the point of having to make changes to keep up with competitors. Netcore is an essential step in the. NET evolution process. It combines the best. NET framework with the practices used in modern software development. Features such as portability, simple deployment, high performance, open source and strong support make it worth a try.

Why choose. NET Core?

Related Article

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: info-contact@alibabacloud.com 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.