This problem has returned from last year and now I have to solve it. Are
there any build or NuGet boffins here?

I have to include a C++ DLL in a NuGet package and have it delivered into
the consumer's build output folder just like a .NET assembly. It must work
for both Framework and Sdk project consumers. I have burnt away hours on
research and run a hundred experiments with only meagre success.

I originally hoped there was a way of placing the native DLL in a special
package folder (native/ runtimes/ etc) that will simply cause it to behave
like a .NET assembly, but I don't think this is true. Some people use
build/.targets files and some use Install.ps1 scripts (which are
deprecated?) to cause the DLL to copy on build. There is confusing and
contradictory advice everywhere. I followed THIS
<https://www.dxsdata.com/2019/02/visual-studio-adding-unmanaged-dll-or-any-file-to-projects-nuget-package-output/>
with partial success ... It works in a Framework project, but it never
arrives in an Sdk project.

I'm at wits end and about to put a crowbar through my screen. It's the
simplest possible scenario, I just want one goddam DLL in a package to
arrive in the build output folder.

Has anyone done this? Does anyone know the tricks or have a simple working
example?

*Greg K*

Reply via email to