Microsoft had released .Net Core Tools 1.0 in March, 2017. One of the biggest advantage of these tools are that they are not only supported by Windows, but also have compatibility with Mac and Linux operating systems. The biggest hurdle with development of applications using .Net was that they could not be hosted on Mac and Linux operating system but now with .Net Core Tools, this problem has been overcome by Microsoft.
We can use these tools by command-line, VS code or Visual Studio IDE. These tools can be downloaded at NET Core Downloads
These tools are integrated in Visual Studio 2017. User need to select “.Net Core cross-platform development” while installing Visual Studio to use these tools with IDE.
A Quick Tour of .NET Core
Microsoft has made some of the key improvements in .Net Code. Let’s take a look, starting with the command-line experience, and then moving to Visual Studio.
Command-line experience
User can create and run .Net Core application on their OS (Windows or Mac or Linux) using command line. User must install .NET Core SDK to use command line interface. Here is what the experience looks like on Windows.
C:\>dotnet new console -o myconsoleapp
The template "Console Application" created successfully.
The above command creates a new console application
C:\>cd myconsoleapp
C:\myconsoleapp>dotnet restore
Restoring packages for C:\myconsoleapp\myconsoleapp.csproj...
Restore command restores all the nugget packages for the application.
C:\myconsoleapp>dotnet run
Hello World!
Run command builds and runs the project.
Visual Studio Templates
There are few new templates introduced in Visual Studio 2017, for .NET Core, ASP.NET Core and .NET Standard. User can see them in New project dialog. Here is the snapshot.
ASP.NET Core template is used for creating Web app and Services. .NET Core template is used for creating Tools or .NET Core experimentation. .NET Standard template is used for creating class libraries which can be used as reference in multiple project.
We also have provision to select Version on .Net Core while creating new ASP.NET Core application. See the experience in the following screenshot.
Editing csproj files in Visual Studio
Now user can edit .NET Core project event when the project is in running mode and loaded. User can right click on the .csproj file and select Edit. In edit mode, user can add/remove references or packages without having to unload the project. See the new experience in the following screenshot.
.NET Standard Project-to-Project References
.NET Standard Libraries project type can be user with almost all .Net project types. Earlier we used to create portable class libraries. User can now reference .NET Standard projects and NuGet packages from .NET Framework, Xamarin and Universal Windows Apps. The snapshot below shows a .NET Framework console app with a project dependency on a .NET Standard project, which has dependencies on two popular NuGet packages.
0 Comment(s)