.NET Core Application Development in Visual Studio Code
.NET Core
ASP.NET Core is an open source and platform-independent software framework for developing web, mobile, and desktop-based applications using Windows, Mac, and Linux operating systems (a developer can develop the desktop application from .NET Core 3.0). command line interface for developing the applications be supported by .NET
ASP.NET Core fully supports C#, F#, and partially supports VB.NET. Now a days, VB.NET compiles and runs on .NET Core, but the separate Visual Basic Runtime is not implemented. Microsoft tells that the latest version, .NET Core 3 will include the Visual Basic Runtime.
Why .NET Core?
Due to the following reasons, developers should use the .NET Core framework for development.
- Cross-Platform Development
- Targeting Microservices.
- Lightweight
- Docker Containers support
- High-performance and scalable systems
- Side-by-side .NET versions per application.
Almost all of the developers that is .NET developers are accustomed to developing applications using the Visual Studio IDE from Microsoft. But this has a limitation that Visual Studio was a Windows application.
This meant that you needed a Windows OS machine to develop .NET applications using Visual Studio. But with the introduction of .NET Core, which is both open source and cross-platform, Microsoft turned over a new leaf. .NET Core, a total rewrite of the .NET Framework came with a CLI tool, referred to as .NET CLI, can be used by developers who don’t wish to use Visual Studio for developing .NET applications with the help of command line and just a text editor of their preference.
https://www.exltech.in/dot-net-training.html
For developing our first .NET Core application using Visual Studio Code we will use the .NET CLI tool.
1.Create an empty folder. Name it DotNet Core Sample. Right click on that folder. From the displayed context menu, select Open with Code option. This will open the Visual Studio Code with a selected folder as your workspace.
2.Use
Ctrl+` (backtick character) shortcut to open the built-in terminal in
Visual Studio Code.
3.We will be creating a basic console application using the dotnet CLI. Type dotnet new console –name DotNetCoreSample in the terminal window and press Enter. The .NET CLI tool will create a console application with a Program.cs file and will restore the packages required for the project. See the figure below.
4.We
will be creating a basic console application using the dotnet CLI.
Type dotnet
new console –name DotNetCore Sample in
the terminal window and press Enter. The .NET CLI tool will create a
console application with a Program.cs file and will restore the
packages required for the project. See the figure below.
5.In the Program.cs file, change the Hello World string to My First .NET Core Program. Save the file and go to the terminal.
6.Navigate to the directory in which Program.cs is located from the terminal. Type cd DotNetCoreSample and press Enter. Now, type the command dotnet run in the terminal and press Enter.
now we have created a simple .NET Core console application using Visual Studio Code. We have leveraged the new .NET CLI commands to create and run the project.
For
more information visit us:https://www.exltech.in
