When I try to use the built-in feature of creating Nuget packages in VS 2017 (for a .NET Standard class library), it doesn't include any dependencies (project references), it includes only the DLL of the current project...
Here is my project file:
<Project Sdk="Microsoft.NET.Sdk">
.
.
<PropertyGroup>
<TargetFrameworks>netstandard1.6;net47</TargetFrameworks>
<PreserveCompilationContext>true</PreserveCompilationContext>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeBuildOutput>True</IncludeBuildOutput>
<IncludeContentInPack>True</IncludeContentInPack>
<DevelopmentDependency>False</DevelopmentDependency>
</PropertyGroup>
.
.
</Project>
I tried different values for: DevelopmentDependency, IncludeContentInPack, IncludeBuildOutput, and it is the same.
I tried also on VS 2017 preview release as well.
When I try to use the built-in feature of creating Nuget packages in VS 2017 (for a .NET Standard class library), it doesn't include any dependencies...
I aware of you want to pack nuget package include the referenced projects by Visual Studio 2017 directly. But I found that VS 2017 take the project references as dependencies when you pack package by VS 2017, I have not found a values to pack package include the referenced project as DLL file by VS directly.
As a workaround, you can use nuget and .nuspec file to include the referenced project, below is my .nuspec file:
<?xml version="1.0"?>
<package >
<metadata>
<id>MyTestNuGetPackage</id>
<version>1.0.0</version>
<authors>Test</authors>
<owners>Test</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Package description</description>
<releaseNotes>Summary of changes made in this release of the package.
</releaseNotes>
<copyright>Copyright 2017</copyright>
<tags>Tag1 Tag2</tags>
</metadata>
<files>
<file src="bin\Debug\netstandard1.6\MyTestNuGetPackage.dll" target="lib\netstandard1.6" />
<file src="bin\Debug\netstandard1.6\ReferencedProject.dll" target="lib\netstandard1.6" />
<file src="bin\Debug\net47\MyTestNuGetPackage.dll" target="lib\net47" />
<file src="bin\Debug\net47\ReferencedProject.dll" target="lib\net47" />
</files>
</package>
Then use the command: nuget pack .nuspec
to create the nuget package.
For the detail info, you can refer to the Create .NET standard packages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With