To know the action binded to a shortcut, you can search the shortcut: "ctrl+d"
Utilisation
# créé le template "Console Application" (vscode.csproj Program.cs)
dotnet new console
# lister les templates disponibles
dotnet new -l
# lancer VS code dans le répertoire courant
code .
À l'ouverture de vscode, les éléments manquants sont téléchargés automatiquement (OmniSharp, .NET Core Debugger)
Cette extension recherche dans le dossier courant les fichiers *.csproj et *.sln pour découvrir les projects de test.
# create a folder and a file MySolution/MySolution.sln
dotnet new sln -o MySolution
# add projets to the solution
dotnet sln add ./MyProject/MyProject.csproj
{"label":"roslynator","command":"roslynator","type":"shell","args":["analyze","--analyzer-assemblies","~/.vscode/extensions/josefpihrt-vscode.roslynator-4.3.0/roslyn/common","~/.vscode/extensions/josefpihrt-vscode.roslynator-4.3.0/roslyn/analyzers"],"problemMatcher":[{"owner":"roslynator","fileLocation":["relative","${workspaceFolder}"],// if it is run for a solution, it missed the project folder"pattern":[{"regexp":"^(.+?)\\((\\d+),(\\d+)\\): (warning|error) (.+?): (.+?)$","file":1,"line":2,"column":3,"severity":4,"code":5,"message":6}]}]},{"label":"code style","command":"dotnet","type":"shell","args":["format","--verify-no-changes"],"problemMatcher":[{"owner":"dotnet","fileLocation":"absolute","pattern":[{"regexp":"^(.+?)\\((\\d+),(\\d+)\\): (warning|error) (.+?): (.+?) \\[.+\\]$","file":1,"line":2,"column":3,"severity":4,"code":5,"message":6}]}]}
The "Microsoft.AspNetCore.Razor.Tasks.DiscoverDefaultScopedCssItems" task could not be loaded from the assembly /usr/share/dotnet/sdk/5.0.204/Sdks/Microsoft.NET.Sdk.Razor/build/netstandard2.0/../../tasks/net46/Microsoft.NET.Sdk.Razor.Tasks.dll.
Invalid Image Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Create the folder /usr/share/dotnet/sdk/5.0.204/Sdks/Microsoft.NET.Sdk.Razor/tasks/net46 and copy the following files:
C# debugging doesn't start the application.
Microsoft .NET Core Debugger only works with Microsoft Visual Studio Code and not with Visual Studio Code OSS (link).
# Afficher le nombre max de fichiers qui peuvent être surveilléscat /proc/sys/fs/inotify/max_user_watches
# Modifier temporairement le nombre max de fichiers qui peuvent être surveillésecho 65536 > /proc/sys/fs/inotify/max_user_watches
# Modifier le nombre max de fichiers qui peuvent être surveillés (Archlinux)echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system
Microsoft.Common.props was not found
Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "/usr/lib/mono/xbuild/15.0/Microsoft.Common.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. /opt/dotnet/sdk/2.1.105/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.props