m .Net Dev
Key Points
- .Net is open-source from Microsoft
- .Net core runs on windows, Linux and MAC OSX
- Developers user .Net core SDK to build .Net apps on the platforms above using Visual Studio or VSCode
References
Reference_description_with_linked_URLs_______________________ | Notes______________________________________________________________ |
---|---|
https://dotnet.microsoft.com/learn/dotnet/what-is-dotnet | |
https://docs.microsoft.com/en-us/dotnet/core/tutorials/index | .NET Tutorials |
https://dotnet.microsoft.com/learn/dotnet/architecture-guides | .NET architecture guides |
https://docs.microsoft.com/en-us/dotnet/ | .NET docs |
https://dotnet.microsoft.com/download | |
https://hub.docker.com/_/microsoft-dotnet-core/ | .NET core on Docker |
Key Concepts
.NET Core is an open-source, general-purpose development platform maintained by Microsoft and the .NET community on GitHub. It's cross-platform (supporting Windows, macOS, and Linux) and can be used to build device, cloud, and IoT applications.
See About .NET Core to learn more about .NET Core, including its characteristics, supported languages and frameworks, and key APIs.
Check out .NET Core Tutorials to learn how to create a simple .NET Core application. It only takes a few minutes to get your first app up and running. If you want to try .NET Core in your browser, look at the Numbers in C# online tutorial.
https://docs.microsoft.com/en-us/dotnet/core/about
.NET Core has the following characteristics:
- Cross-platform: Runs on Windows, macOS, and Linux operating systems.
- Consistent across architectures: Runs your code with the same behavior on multiple architectures, including x64, x86, and ARM.
- Command-line tools: Includes easy-to-use command-line tools that can be used for local development and in continuous-integration scenarios.
- Flexible deployment: Can be included in your app or installed side-by-side (user-wide or system-wide installations). Can be used with Docker containers.
- Compatible: .NET Core is compatible with .NET Framework, Xamarin, and Mono, via .NET Standard.
- Open source: The .NET Core platform is open source, using MIT and Apache 2 licenses. .NET Core is a .NET Foundation project.
- Supported by Microsoft: .NET Core is supported by Microsoft, per .NET Core Support.
.NET Core exposes APIs for many scenarios, a few of which follow:
- Primitive types, such as bool and int.
- Collections, such as System.Collections.Generic.List<T> and System.Collections.Generic.Dictionary<TKey,TValue>.
- Utility types, such as System.Net.Http.HttpClient, and System.IO.FileStream.
- Data types, such as System.Data.DataSet, and DbSet.
- High-performance types, such as System.Numerics.Vector and Pipelines.
.NET Core provides compatibility with .NET Framework and Mono APIs by implementing the .NET Standard specification.
.NET Core is composed of the following parts:
- The .NET Core runtime, which provides a type system, assembly loading, a garbage collector, native interop, and other basic services. .NET Core framework libraries provide primitive data types, app composition types, and fundamental utilities.
- The ASP.NET runtime, which provides a framework for building modern cloud-based internet connected applications, such as web apps, IoT apps, and mobile backends.
- The .NET Core CLI tools and language compilers (Roslyn and F#) that enable the .NET Core developer experience.
- The dotnet tool, which is used to launch .NET Core apps and CLI tools. It selects the runtime and hosts the runtime, provides an assembly loading policy, and launches apps and tools.
These components are distributed in the following ways:
- .NET Core Runtime -- includes the .NET Core runtime and framework libraries.
- ASP.NET Core Runtime -- includes ASP.NET Core and .NET Core runtime and framework libraries.
- .NET Core SDK -- includes the .NET CLI Tools, ASP.NET Core runtime, and .NET Core runtime and framework.
The major differences between .NET Core and the .NET Framework:
- App-models -- .NET Core doesn't support all the .NET Framework app-models. In particular, it doesn't support ASP.NET Web Forms and ASP.NET MVC, but it supports ASP.NET Core MVC. And starting with .NET Core 3.0, .NET Core also supports WPF and Windows Forms on Windows only.
- APIs -- .NET Core contains a large subset of .NET Framework Base Class Library, with a different factoring (assembly names are different; members exposed on types differ in key cases). In some cases, these differences require changes to port source to .NET Core. For more information, see The .NET Portability Analyzer. .NET Core implements the .NET Standard API specification.
- Subsystems -- .NET Core implements a subset of the subsystems in the .NET Framework, with the goal of a simpler implementation and programming model. For example, Code Access Security (CAS) isn't supported, while reflection is supported.
- Platforms -- The .NET Framework supports Windows and Windows Server while .NET Core also supports macOS and Linux.
- Open Source -- .NET Core is open source, while a read-only subset of the .NET Framework is open source.
What's new in .Net Core 3.0
https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0
- Language improvements C# 8.0
- .NET Standard 2.1
- Compile/Deploy
- Runtime/SDK
- Windows Desktop & COM
- Linux improvements
- Security
- .NET Core 3.0 API changes
- Next steps
Linux versions supported
https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore30
Note
The .NET Core SDK package is not required for production servers/environments. Only the .NET Core runtime package is needed for apps deployed to production environments. The .NET Core runtime is deployed with apps as part of a self-contained deployment, however, it must be deployed for Framework-dependent deployed apps separately. For more information about framework-dependent and self-contained deployment types, see .NET Core application deployment. Also see Self-contained Linux applications for specific guidelines.
OS | Version | Architectures |
---|---|---|
Red Hat Enterprise Linux | 6+, 7 | x64 |
Oracle Linux | 7 | x64 |
CentOS | 7 | x64 |
Fedora | 29+ | x64 |
Debian | 9+ | x64, ARM32, ARM64 |
Ubuntu | 16.04+ | x64, ARM32, ARM64 |
Linux Mint | 18+ | x64 |
openSUSE | 15+ | x64 |
SUSE Enterprise Linux (SLES) | 12 SP2+ | x64 |
Alpine Linux | 3.8+ | x64, ARM64 |
Simple HelloWorld app
After installing the .NET Core SDK, open a command prompt. Type the following dotnet
commands to create and run a C# application:
dotnet new console
dotnet run
You should see the following output:
Hello World!
Building apps in VS Code
https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code
Prerequisites
- Install Visual Studio Code.
- Install the .NET Core SDK.
- Install the C# extension for Visual Studio Code. For more information about how to install extensions on Visual Studio Code, see VS Code Extension Marketplace.
Hello World
Let's get started with a simple "Hello World" program on .NET Core:
Open a project:
Open Visual Studio Code.
Click on the Explorer icon on the left menu and then click Open Folder.
Select File > Open Folder from the main menu to open the folder you want your C# project to be in and click Select Folder. For our example, we're creating a folder for our project named HelloWorld.
Initialize a C# project:
Open the Integrated Terminal from Visual Studio Code by selecting View > Integrated Terminal from the main menu.
In the terminal window, type
dotnet new console
.This command creates a Program.cs file in your folder with a simple "Hello World" program already written, along with a C# project file named HelloWorld.csproj.
Resolve the build assets:
For .NET Core 1.x, type
dotnet restore
. Runningdotnet restore
gives you access to the required .NET Core packages that are needed to build your project.Note
Starting with .NET Core 2.0 SDK, you don't have to run
dotnet restore
because it's run implicitly by all commands that require a restore to occur, such asdotnet new
,dotnet build
anddotnet run
. It's still a valid command in certain scenarios where doing an explicit restore makes sense, such as continuous integration builds in Azure DevOps Services or in build systems that need to explicitly control the time at which the restore occurs.
Run the "Hello World" program:
Type
dotnet run
.
You can also watch a short video tutorial for further setup help on Windows, macOS, or Linux.
Potential Value Opportunities
Potential Challenges
Candidate Solutions
Step-by-step guide for Example
sample code block