m .Net Dev

Key Points

  1. .Net is open-source from Microsoft
  2. .Net core runs on windows, Linux and MAC OSX
  3. Developers user .Net core SDK to build .Net apps on the platforms above using Visual Studio or VSCode


References


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:

.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

  1. Language improvements C# 8.0
  2. .NET Standard 2.1
  3. Compile/Deploy
  4. Runtime/SDK
  5. Windows Desktop & COM
  6. Linux improvements
  7. Security
  8. .NET Core 3.0 API changes
  9. 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.

OSVersionArchitectures
Red Hat Enterprise Linux6+, 7x64
Oracle Linux7x64
CentOS7x64
Fedora29+x64
Debian9+x64, ARM32, ARM64
Ubuntu16.04+x64, ARM32, ARM64
Linux Mint18+x64
openSUSE15+x64
SUSE Enterprise Linux (SLES)12 SP2+x64
Alpine Linux3.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:

.NET Core CLI
dotnet new console
dotnet run

You should see the following output:

output
Hello World!


Building apps in VS Code

https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code


Prerequisites

  1. Install Visual Studio Code.
  2. Install the .NET Core SDK.
  3. 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:

  1. 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.

      Visual Studio Code open folder

  2. 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.

      The dotnet new command

  3. Resolve the build assets:

    • For .NET Core 1.x, type dotnet restore. Running dotnet restore gives you access to the required .NET Core packages that are needed to build your project.

      The dotnet restore command

      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 as dotnet new, dotnet build and dotnet 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.

  4. Run the "Hello World" program:

    • Type dotnet run.

      The dotnet run command

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

sample code block
 



Recommended Next Steps