- following this video "Intro to VSCode for C# Developers"
- install .NET Core 3.1 SDK (v3.1.201) for Mac
- https://dotnet.microsoft.com/download
- check
dotnet --version
to see3.1.201
- install VSCode extension
ms-dotnettools.csharp
ms-mssql.mssql
jmrog.vscode-nuget-package-manager
eamodio.gitlens
(optional)vscode-icons-team.vscode-icons
(optional)
- create solution and projects from the video
cd VSCodeIntro/
# create solution
dotnet new sln -n "VSCodeIntroSln"
# create project
dotnet new console -n "IntroUI"
# create library
dotnet new classlib -n "IntroLibrary"
# add project and library to solution
dotnet sln VSCodeIntroSln.sln add **/*.csproj
# create reference to library
dotnet add IntroUI/IntroUI.csproj reference IntroLibrary/IntroLibrary.csproj
# open each directories and answer Yes when asked required assets missing
code IntroUI/
code .
# check launch.json have program IntroUI.dll
NuGet
# NuGet from CLI
cd IntroLibrary/
dotnet add package Dapper
# add Dapper to IntroLibrary.csproj copy <ItemGroup>...</ItemGroup>
# paste to IntroUI.csproj and click Restore as suggested
# NuGet from View > Command Palette
# NuGet Package Manager: Add Package > SeriLog
# select the latest version then click Restore
- In case VSCode didn't suggest to restore, run manually
cd VSCodeIntro/
dotnet restore
Editing Shortcuts
cw
:System.Console.WriteLine();
prop
: class property
- install from NuGet Package Manager
Dapper
Microsoft.Data.SqlClient
System.Configuration.ConfigurationManager
- follow the Getting Started at https://dapper-tutorial.net/
- VSCode menu Run > Run Without Debugging
- You should see the query result
- Official Setup Guide and Quick Tutorials
- Using .NET Core in Visual Studio Code
- Working with C#
- Hello World in 10 minutes
- JAVAを数年触ったエンジニアがC#を学んで感じたこと