I have a vs solution with 3 projects.
I would like to create a nuget package from them.
I created a .nuspec file:
<dependencies><group targetFramework=".NETStandard2.0"><dependency id="Castle.Windsor" version="5.1.2" exclude="Build,Analyzers" /> <dependency id="Newtonsoft.Json" version="13.0.1" exclude="Build,Analyzers" /></group></dependencies><tags></tags></metadata><files><filesrc="..\Air.Configuration\obj\**\Air.Configuration.dll"target="lib\.NETStandard2.0" /><file src="..\Air.Model\obj\**\Air.Model.dll" target="lib\.NETStandard2.0" /><file src="..\Air.Proxy\obj\**\AirProxy.dll" target="lib\.NETStandard2.0" /></files>
When I pack it on my local machine, using nuget pack command, the nuget package created successfully, I can import this nuget package to a vs project.
After that I create an Azure pipeline and I use the Nuget task
But after the nuget package creation I get this warning message:
WARNING: NU5128: Some target frameworks declared in the dependencies group of the nuspec and the lib/ref folder do not have exact matches in the other location. Consult the list of actions below:
- Add lib or ref assemblies for the netstandard2.0 target framework
Successfully created package 'D:\Core-NET60-Agent-1_work\152\a\NugetPackages\Air.2.0.1.nupkg'. Finishing: NuGet pack
And the lib folder which should contains the 3 dlls is not created.
the log message:
C:\Windows\system32\chcp.com 65001Active code page: 65001Attempting to pack file: D:\Core-NET60-Agent-1_work\152\s\Air\Build\Air.nuspecD:\Core-NET60-Agent-1_work_tool\NuGet\6.1.0\x64\nuget.exe pack D:\Core-NET60-Agent-1_work\152\s\Air\Build\Air.nuspec -NonInteractive -OutputDirectory D:\Core-NET60-Agent-1_work\152\a\NugetPackages -Properties Configuration=Release -Verbosity DetailedNuGet Version: 6.1.0.106Attempting to build package from 'Air.nuspec'.
- Id: Air Version: 2.0.1
- Authors: ...
- Description: Core Air Components
- Dependencies: Castle.Windsor [5.1.2, ), Newtonsoft.Json [13.0.1, )
- Added file '[Content_Types].xml'.
- Added file '_rels/.rels'.
- Added file 'content/app.config.install.xdt'.
- Added file 'content/web.config.install.xdt'.
- Added file 'package/services/metadata/core-properties/8d7f5907a35d4d8fb7e6b90224a5eaf2.psmdcp'
- Added file 'Air.nuspec'.
I could not find any example how I can create a solution level nuget package.
Anybody could help me?