Benutzer-Werkzeuge

Webseiten-Werkzeuge


coding:dotnet

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
coding:dotnet [2025/12/12 20:34]
admin
coding:dotnet [2026/01/18 23:14] (aktuell)
jango
Zeile 2: Zeile 2:
  
 Plattformunabhängige, projektorientierte Programmiersprache von Microsoft. Wie [[csharp|C#]] ohne UI zeug. [[powershell|Powershell]] versteht .NET. Plattformunabhängige, projektorientierte Programmiersprache von Microsoft. Wie [[csharp|C#]] ohne UI zeug. [[powershell|Powershell]] versteht .NET.
 +
 +<code>
 +dotnet --list-runtimes
 +dotnet --list-sdks
 +</code>
 +
 +<code powershell>
 +$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
 +</code>
  
 .Net App erstellen .Net App erstellen
  
 <code> <code>
-dotnet new [console|wpf|library] -o MyApp --framework net6.0+dotnet new [console|wpf|library] -o MyApp -f net8.0
 cd MyApp cd MyApp
 dotnet add package System.Management --version 8.0.0 dotnet add package System.Management --version 8.0.0
 dotnet run [parameters] dotnet run [parameters]
-dotnet publish -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true+dotnet publish -c Release -r win-x86 /p:SelfContained=true /p:PublishSingleFile=true -f net8.0
 </code> </code>
  
Zeile 17: Zeile 44:
 <code> <code>
 dotnet nuget add source "https://api.nuget.org/v3/index.json" --name "nuget.org" dotnet nuget add source "https://api.nuget.org/v3/index.json" --name "nuget.org"
 +</code>
 +
 +<code>
 +/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
 </code> </code>
coding/dotnet.1765568069.txt.gz · Zuletzt geändert: 2025/12/12 20:34 von admin