C-Sharp: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
https://learn.microsoft.com/en-us/nuget/what-is-nuget | https://learn.microsoft.com/en-us/nuget/what-is-nuget | ||
dotnet new console | |||
dotnet new sln | |||
dotnet run | |||
dotnet --version | dotnet --version | ||
Line 7: | Line 11: | ||
bin\Release\net6.0\win10-x64 | bin\Release\net6.0\win10-x64 | ||
=== NUGET === | === NUGET === | ||
Line 34: | Line 39: | ||
<Nullable>enable</Nullable> | <Nullable>enable</Nullable> | ||
<RuntimeIdentifier>win-x64</RuntimeIdentifier> | <RuntimeIdentifier>win-x64</RuntimeIdentifier> | ||
<!-- https://learn.microsoft.com/en-us/dotnet/core/deploying/single-file/overview?tabs=cli --> | |||
<PublishSingleFile>true</PublishSingleFile> | <PublishSingleFile>true</PublishSingleFile> | ||
<SelfContained>true</SelfContained> | <SelfContained>true</SelfContained> | ||
<PublishReadyToRun>true</PublishReadyToRun> | <PublishReadyToRun>true</PublishReadyToRun> | ||
</PropertyGroup> | </PropertyGroup> |
Revision as of 13:21, 14 February 2024
https://learn.microsoft.com/en-us/nuget/what-is-nuget
dotnet new console dotnet new sln dotnet run
dotnet --version dotnet run dotnet restore dotnet publish -c Release -r win10-x64
bin\Release\net6.0\win10-x64
NUGET
NuGet is the package manager for .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers. https://learn.microsoft.com/en-us/nuget/quickstart/install-and-use-a-package-in-visual-studio
dotnet nuget locals all --clear dotnet nuget list source dotnet add package Microsoft.NETCore.App.Runtime.win-x64 --version 6.0.9 dotnet add package System.IO.Packaging --version 6.0.0
Powershell
Get-PackageSource
Install-Package Microsoft.NETCore.App.Runtime.win-x64 https://www.powershellgallery.com/
<PropertyGroup> <OutputType>Exe</OutputType> <TargetFramework>net6.0</TargetFramework> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> <RuntimeIdentifier>win-x64</RuntimeIdentifier> <PublishSingleFile>true</PublishSingleFile> <SelfContained>true</SelfContained> <PublishReadyToRun>true</PublishReadyToRun> </PropertyGroup>