https://docs.microsoft.com/en-us/dotnet/core/compatibility/5.0
Edit csproj, change from:
<TargetFramework>netcoreapp3.1</TargetFramework>
to:
<TargetFramework>net5.0</TargetFramework>
Lists all installed sdk and runtime:
dotnet --info
- https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools
- https://learn.microsoft.com/en-us/dotnet/core/diagnostics/tools-overview
- https://www.nuget.org/packages?packagetype=dotnettool
Open Visual Studio's Package Manager Console (where Package Source https://api.nuget.org/v3/index.json
is configured) and start:
dotnet tool install --global dotnet-dump
dotnet tool install --global dotnet-ef
dotnet tool install --global dotnet-gcdump
dotnet tool install --global dotnet-trace
dotnet tool install --global dotnet-counters
dotnet tool install --global dotnet-symbol
dotnet tool install --global Microsoft.Web.LibraryManager.Cli
- There the shortcut for --global: -g
- You can add specific versions. example --version 3.*
Updates:
dotnet tool update -g dotnet-dump
dotnet tool update -g dotnet-ef
dotnet tool update -g dotnet-gcdump
dotnet tool update -g dotnet-trace
dotnet tool update -g dotnet-counters
dotnet tool update -g dotnet-symbol
dotnet tool update -g Microsoft.Web.LibraryManager.Cli
IMPORTANT: Do not install tools globally. Use dotnet-tools.json + 'dotnet tool restore' instead. Using this technique, you can have more than 1 .NET version on your build server. Details see: https://learn.microsoft.com/en-us/dotnet/core/tools/local-tools-how-to-use
Using nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<activePackageSource>
<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
</activePackageSource>
</configuration>
tool-update.cmd
SET nugetFile=.\nuget.config
dotnet tool uninstall -g dotnet-dump
dotnet tool uninstall -g dotnet-ef
dotnet tool uninstall -g dotnet-gcdump
dotnet tool uninstall -g dotnet-trace
dotnet tool uninstall -g dotnet-counters
dotnet tool uninstall -g dotnet-symbol
dotnet tool uninstall -g Microsoft.Web.LibraryManager.Cli
dotnet tool update -g dotnet-dump --configfile %nugetFile%
dotnet tool update -g dotnet-ef --configfile %nugetFile%
dotnet tool update -g dotnet-gcdump --configfile %nugetFile%
dotnet tool update -g dotnet-trace --configfile %nugetFile%
dotnet tool update -g dotnet-counters --configfile %nugetFile%
dotnet tool update -g dotnet-symbol --configfile %nugetFile%
dotnet tool update -g Microsoft.Web.LibraryManager.Cli --configfile %nugetFile%
dotnet tool list --global
dotnet counters
dotnet trace
dotnet dump
dotnet monitor
install or upgrade project converter
dotnet tool install -g try-convert
install or upgrade "Upgrade assistant"
dotnet tool install -g upgrade-assistant
Details: https://github.com/dotnet/upgrade-assistant
In a CI/CD project, it is recommended to install the tools locally.
https://andrewlock.net/new-in-net-core-3-local-tools/
Do not use it for new projects. Consider alternatives: Pure functions (faster, less hassle, compile time error instead of runtime error)
- https://cezarypiatek.github.io/post/why-i-dont-use-automapper/
- https://ivanazure.wordpress.com/2015/12/02/why-automapping-is-bad-for-you/
- Generates mapper code (to get compile time error instead of runtime error) https://mapperly.riok.app/
- If you have it in your old project: AutoMapper Usage Guidelines https://www.jimmybogard.com/automapper-usage-guidelines/
- Install LibMan
- Right-Click on your project: Add... Client-Side Library