Environment requirement
- Visual Studio 2019/2022 (with .NET SDK)
- dotnet CLI (dotnet --version)
- Access to your private feed, e.g. nuget.local
- Your API key (e.g. nugetfeed)
Enable multi-framework (multi-targeting) at project configuration file(.csproj)
Visual Studio’s GUI only lets you pick one framework. To target multiple, edit the project file.- In Solution Explorer → right-click the project → Edit Project File.
- Replace <TargetFramework> with <TargetFrameworks> (semicolon-separated).
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
Fill nuget package metadata in Visual Studio
- Right-click project → Properties → Package tab.
-
Fill:
- Package ID: Geo.OpenDataExtender
- Version: e.g., 1.0.0
- Authors, Company, Description, Repository URL, License (if applicable)
After filled
1. Open windows console at the main project file. Then input commend to package module.dotnet pack -c Release
The result will like this
2. Push the module to nuget server.
ddotnet nuget push bin\Release\module.version.nupkg --source "https://nuget.geo.local/nuget" --api-key geo.developer --skip-duplicate
For exmple
dotnet nuget push bin\Release\Geo.OpenDataExtender.1.0.0.nupkg --source "https://nuget.local" --api-key nugetfeed --skip-duplicate


No comments:
Post a Comment