Создал новый солюшен TestSL и в него добавил сторонний пакет с NuGet.
И теперь вопрос, я хочу упаковать TestSL и выложить в NuGet, после чего, с под нового пакета TestSL, хочу вызывать пакет который добавил ранее в TestSL. Как это можно сделать?
Install the NuGet command-line tool (nuget.exe) by downloading it from the NuGet website (https://www.nuget.org/) or by using the .NET Core CLI: dotnet tool install -g NuGet.CommandLine Change to the directory that contains the library project (e.g., TestSL) and its related files (e.g., .csproj, .nuspec). Create a NuGet package specification file (a .nuspec file) that describes the package metadata (e.g., name, version, dependencies). You can use the nuget spec command to generate a template for the .nuspec file: nuget spec Edit the .nuspec file to specify the metadata and files for the package. You can find more information about the format and content of the .nuspec file on the NuGet documentation website (https://docs.microsoft.com/en-us/nuget/reference/nuspec). Use the nuget pack command to create a NuGet package from the .nuspec file: nuget pack TestSL.nuspec Use the nuget push command to upload the NuGet package to the NuGet Gallery (https://www.nuget.org/): nuget push TestSL.{version}.nupkg To use the NuGet package that you just published in another project, you can follow these steps:
Create a new project (e.g., TestSL.Consumer) and add a reference to the NuGet package. You can use the dotnet add package command to add the package to the project: dotnet add package TestSL Use the namespace and types from the NuGet package in your code. For example:
using TestSL;
namespace TestSL.Consumer { class Program { static void Main(string[] args) { // Use the types from the NuGet package var foo = new Foo(); foo.DoSomething(); } } }
You can also use the NuGet Package Manager UI in Visual Studio to add, remove, and update NuGet packages in your projects.