I created a project that compiles to ProjectA.dll. ProjectA references a managed dll (Managed.dll), which it obviously needs to work. I'm trying to package both the dlls into a NuGet package, which seems to be working as far as I can tell. If I look in the .nupkg I see both dlls in the lib directory.
When I consume the NuGet package from another project, the Managed.dll file is not installed (or copied to the build directory). I've tried a bunch of different solutions I found on StackOverflow, as well as solutions suggested by AI. Unfortunately, most of the information I find is old, outdated, and didn't work.
I've added the following code to my .csproj file, which does copy the Managed.dll into the lib directory in the NuGet package.
<ItemGroup><Content Include="..\..\lib\Managed.dll"><Pack>true</Pack><PackagePath>lib\net8.0</PackagePath><CopyToOutputDirectory>true</CopyToOutputDirectory></Content></ItemGroup>
When I try to use the NuGet package in a separate project, the Managed.dll doesn't get installed or copied to the build output folder.
I've resorted to just randomly adding more elements to my .csproj file to try and get this to work, so any help that's not old and outdated would be much appreciated.