Code Mahek
  • Blog
  • About
  • Contact
  • Random Clicks
  • Resume
  • Ava Chat Bot

Fragrance
​of Programming

Getting Started with .Net Core

7/17/2017

Comments

 
Today I thought of starting a series of blog on Asp.net core. So before start coding we need to download and install Asp.net core. You can browse to https://www.microsoft.com/net/download and download .net core. You can download the binaries or can even download the tools which will integrate directly to Visual Studio 2017. You can download Visual Studio 2017 Community version from www.visualstudio.com
Picture
After downloading and installing, we can directly start with the basic code. Let's create a sample hello world program. Dotnet core comes with command line called "dotnet" and it has number of commands you can use. We will start with the basic command "new", "restore" and "build".
Picture
  • dotnet new command will create project
  • dotnet restore will restore all the nuget dependency that your project need
  • dotnet build will build the project
  • And last the most important one, dotnet run will compile and executes the code
Now in command prompt type "dotnet new". With that command you will see that it gives you number of project types that it will support. Also, in that you can even specify the framework.
Picture
Now I will start with a simple dotnet console application. So I will type "dotnet new console" in the command prompt and it will quickly create the console application. Now if you open program.cs file, you will see that it's a simple Hello World console program.

Now my second command will be "dotnet restore". Currently it won't do anything since there are no dependency on any NuGet package. If our application has any nuget package to download than restore command will get all the required nuget dependency.

After restoring, now let's build our project by typing the command "dotnet build" and with this it will create the corresponding dll. Now the last thing is "dotnet run", and it will run our console application.

This is just basic console application which we created using dotnet core. In my next blog of this series we will create an actual web project using Visual Studio.
Comments
comments powered by Disqus

    RSS Feed

    Categories

    All
    Azure
    C#
    Cloud
    CodeProject
    CSharp
    DotNet Core
    Jetbrains
    .NET
    Rider
    Source Generators
    SQL
    Tech News
    Ubuntu
    Visual Studio 2015
    Visual Studio 2019
    Windows
    Windows 10

    Archives

    May 2020
    February 2019
    January 2019
    December 2018
    May 2018
    December 2017
    November 2017
    October 2017
    September 2017
    July 2017
    May 2017
    April 2017
    May 2015
    April 2015
    March 2015

    View my profile on LinkedIn

Location

Contact Us

    Subscribe Today!

Submit
  • Blog
  • About
  • Contact
  • Random Clicks
  • Resume
  • Ava Chat Bot