Plattformunabhängige, projektorientierte Programmiersprache von Microsoft. Wie C# ohne UI zeug. Powershell versteht .NET.
dotnet --list-runtimes dotnet --list-sdks
$installDir="$env:USERPROFILE\.dotnet" # Get installer script iwr https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-install.ps1 # .NET 8 (LTS) SDK .\dotnet-install.ps1 -Channel 8.0 -InstallDir $installDir # .NET 9 SDK # .\dotnet-install.ps1 -Channel 9.0 -InstallDir $installDir # Nur .NET Runtime # .\dotnet-install.ps1 -Runtime dotnet -Channel 8.0 -InstallDir $installDir # Nur ASP.NET Core Runtime # .\dotnet-install.ps1 -Runtime aspnetcore -Channel 8.0 -InstallDir $installDir # Nur WindowsDesktop Runtime # .\dotnet-install.ps1 -Runtime windowsdesktop -Channel 8.0 -InstallDir $installDir
.Net App erstellen
dotnet new [console|wpf|library] -o MyApp -f net8.0 cd MyApp dotnet add package System.Management --version 8.0.0 dotnet run [parameters] dotnet publish -c Release -r win-x86 /p:SelfContained=true /p:PublishSingleFile=true -f net8.0
Paketquellen installieren
dotnet nuget add source "https://api.nuget.org/v3/index.json" --name "nuget.org"
/p:PublishSingleFile=true /p:SelfContained=true // inklusive der .NET Runtime, kann auf dem Zielsystem ohne installierte .NET Runtime laufen /p:PublishTrimmed=true // kann bei Reflection/dynamischem Laden Probleme machen /p:EnableCompressionInSingleFile=true