I can create a proper nuget package for my .net standard 2.0 library by right clicking the project in VS2019 and selecting pack.
The .nuspec contains
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>SBD.Standard</id>
<version>1.0.0</version>
<authors>SBD.Standard</authors>
<owners>SBD.Standard</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Package Description</description>
<dependencies>
<group targetFramework=".NETStandard2.0">
<dependency id="Microsoft.Data.SqlClient" version="1.1.0" exclude="Build,Analyzers" />
<dependency id="Microsoft.EntityFrameworkCore" version="3.1.1" exclude="Build,Analyzers" />
<dependency id="Microsoft.EntityFrameworkCore.SqlServer" version="3.1.1" exclude="Build,Analyzers" />
<dependency id="Newtonsoft.Json.Schema" version="2.0.7" exclude="Build,Analyzers" />
<dependency id="RestSharp" version="106.10.0" exclude="Build,Analyzers" />
<dependency id="System.Data.SqlClient" version="4.6.1" exclude="Build,Analyzers" />
</group>
</dependencies>
</metadata>
</package>
However if I create the nuget in Azure Devops using the following command in azure-pipelines.yml
- task: DotNetCoreCLI@2
inputs:
command: 'pack'
packagesToPack: '**/SBDSTD.*.csproj'
Then I look at the .nuspec file for the package created it contains
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/10/nuspec.xsd">
<metadata>
<id>SBD.Standard</id>
<version>2.0.0-CI-20200212-174043</version>
<title>SBD.Standard</title>
<authors>SBD.Standard</authors>
<owners>SBD.Standard</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Description</description>
<dependencies />
</metadata>
</package>
How do I get Devops to create the correct .nuspec file?