Quick Introduction of .NET Core 2.0
If you’ve been in IT for more than just a few years, you’ve probably heard the phrase “Wait until the third release” before jumping into a new technology or product. Well, .NET Core had version 1.0 and version 1.1. So here it is, the third release: Introducing .NET Core 2.0. And believe me, now is the time to jump on this bandwagon.
You Get An API, Everyone Gets An API
What’s the big deal about .NET Core 2.0? Well for starters, about how nearly 20,000 more APIs, an increase from about 13,000 to 32,000. Those 32,000 represent a 70 percent coverage of the APIs used by projects in NuGet.org. What does this mean for you? It means there is a much better chance that your existing .NET Framework class libraries will work with .NET Core 2.0.
Want to find out? Microsoft has an easy-to-use tool, APIPort, that you can use to check your existing code. To give you an example of this, I selected a rather large library to check using APIPort: the Rackspace .NET SDK for OpenStack. The result? It scored a 100 percent compatible rating.
That is one of the things .NET Core 2.0 brings to the table.
I Got A Need For Speed
Standards and .NET Everywhere
.NET Core 2.0 supports .NET Standard 2.0. .NET Standard is not an API; rather, it’s a specification. Much like HTML5 is a specification, and browsers are written to support it, likewise .NET Standard is specification. .NET Core 2.0 is compatible with .NET Standard.
What does that mean? How about this: By writing your libraries to the .NET Standard 2.0 specification, they can run anywhere: .NET Core, MONO, .NET Framework. Yes, truly portable code across all devices and operating systems supported by the .NET family.
There are some changes that you’ll notice immediately as well.
Save Some Keystrokes
The first time you run
dotnet new, you’ll notice that
dotnet restore is run automatically. Starting with .NET Core 2.0,
dotnet restore is an implicit command. That is, it will run when necessary, automagically. It can be disabled by using the
Visual Basic and Microservices?
Visual Basic is now supported. Given that a large number of enterprises have a significant investment in VB code, this is a huge win for .NET Core 2.0. Whether you are a fan of VB or not, say it with me: “Microservices written in Visual Basic”. Yes, it’s coming.
Less Code Means More
Your “project” files are now much smaller and easier to understand, especially for ASP.NET MVC applications. For example, to reference all the necessary bits for an MVC application requires only one additional line your project file (Hint: Fire up .NET Core 2.0, type
dotnet new mvc, and look at the *.csproj file).
Get It Today
This is just a quick peek into all the goodness that is .NET Core 2.0. Now is the time to get it installed on your Red Hat Enterprise Linux (RHEL) machine and start coding. After all, this is the third release (1.0, 1.1, 2.0), and third time’s a charm.
What? You don’t have a RHEL virtual machine running on your Windows PC or Mac? Jump over to the Red Hat Developers Site and grab a zero-cost copy of the Red Hat Enterprise Linux pronto. You’ll be coding .NET on RHEL in minutes.
You have RHEL but don’t have .NET Core 2.0 installed? You will find the installation instructions here.
Join the Red Hat Developer Program (it's free) and get access to related cheat sheets, books, and product downloads.