serving the solutions day and night

Pages

Showing posts with label visual studio 2017. Show all posts
Showing posts with label visual studio 2017. Show all posts

Sunday, August 23, 2020

Visual Studio Code

Install the latest version of C# for Visual Studio Code from the marketplace or via the Extensions tab. 

With Visual Studio Code open, press Ctrl+Shift+X and search for C#, install  C# for Visual Studio Code by Microsoft.

Install  .NET Core 3.0 SDK or later 




Saturday, August 15, 2020

.NET Core CLI Commands

  • dotnet new: Creates a new project from the specified template. If you want to create an MVC application, you can use dotnet new mvc. 
  • dotnet restore: Restores all the NuGet dependencies of our application. 
  • dotnet build: Builds our project. 
  • dotnet run: Executes our project. 
  • dotnet watch run: Runs our project and watches for file changes to rebuild and rerun it. 
  • dotnet publish: Creates a deployable build (the .dll) of our project. 
  • dotnet --list-sdks : look all net version in your computer

 


Monday, October 23, 2017

Visual Studio 2017 - C# 7.0 Features


1. Out Variables
static void Main(string[] args)
{
    string first = "M";
    string last = "K";
    string name = string.Empty; //have to pre-declare before using the out.
    GetName(first, last, out name);

    //In c# 7.0, you can declare in the variable line
    GetName(first, last, out string name1);
    GetName(first, last, out var name2); ////use var instead of string
}

static void GetName(string first, string last, out string name)
{
    name = first + " " + last;
}