Referenced Assemblies not included in NuGet package

38 views Asked by At

I'm using nuget.exe to package my standard 2.0 library project which has a NuGet reference to protobuf-net v2.4.6. It used to include the protobuf dll inside the /lib/netstandard2.0 folder of the nupkg file it generated, however that recently stopped and I cannot find any changes to the source other than updating my library's version numbers. I've tried running

nuget.exe pack MyProj.csproj -OutPutDirectory c:\nugetOut\1 -Properties Configuration=Release -IncludeReferencedProjects

and

nuget.exe pack MyProj.csproj -OutPutDirectory c:\nugetOut\2 -Properties Configuration=Release

However a comparison tool notes the output only differs in irrelevant areas.

I've tried extracting the generated nuspec file from one of the prior output folders:

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
  <metadata>
    <id>MyProject</id>
    <version>1.0</version>
    <title>My Project</title>
    <authors>Me</authors>
    <description>My little project</description>
    <copyright>Copyright (c) 2023 Me</copyright>
    <dependencies>
        <group targetFramework=".NETStandard2.0">
            <dependency id="protobuf-net" version="2.4.6" exclude="Build,Analyzers" />
        </group>
    </dependencies>
  </metadata>
</package>

and running

nuget.exe pack MyProj.nuspec -OutPutDirectory c:\nugetOut\3 -Properties Configuration=Release -IncludeReferencedProjects

but the output nupkg contains all the source with no lib folder and looks completely wrong.

I can't quite figure out why I'm not getting the protobuf-net.dll inside my nupkg anymore or how to convince nuget.exe to package it. The documentation suggests any of these steps will work but I'm clearly missing something fundamental. Any tips?

0

There are 0 answers