Skip to content

CSharp

🛠️ Setup

  1. Install C# Extension for VS Code
  2. Check if .NET SDK is installed using the command dotnet --version in terminal. Install .NET SDK, if not already installed.
  3. To create new .NET console project from VSCode, use dotnet new console command in the terminal. To see list of available templates, use the command dotnet new list

C# VS Code Extensions

  1. C# Dev Kit
  2. .NET Extension Pack
  3. C# Extensions by JosKreativ
  4. NuGet Gallery

Run

  1. To run the code, use the command dotnet run in the terminal. Or use F5 or Ctrl + F5.
  2. If you are trying to run a webservice and getting error with htttps, run the command dotnet dev-certs https --trust for the computer to prompt if you want to trust the dev certificate. Confirm the choice.
  3. If you are running into any issues like the webapi service not showing up properly in browser, try the command dotnet watch run.

Learning

  1. Foundational C# by FreeCodeCamp
  2. Microsoft Learn - Get Started with C#
  3. Microsoft Learn - Build .NET Web API with C#
  4. Microsoft Learn - Build Web Apps with Blazor

Design Patterns

  1. C# Design Patterns by DoFactory
  2. ASP.NET MVC Solution Architecture – Best Practices

Coding Standards

C# Coding Standards and Best Practices by DoFactory

Examples

C# Code Examples

Shortcuts

Visual Studio C# Shortcuts

  1. C# Design Patterns by Dmitri Nesteruk