I have created a nuget package via Nuget Package Explorer with the following content.
lib
-- CPPLib.dll
-- DotNetWrapper.dll
CPPLib.dll is the main library with logic implementation (in native C++), and DotNetWrapper.dll is the wrapper which will be reference in C# projects.
When I try to install this nuget package, I got the following error
Install failed. Rolling back...
Install-Package : Failed to add reference to 'CPPLib.dll'.
At line:1 char:16
+ install-package <<<< -id MyPackage
+ CategoryInfo : NotSpecified: (:) [Install-Package], InvalidOperationException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
I know everything in "lib" folder inside the package will be installed as reference, which explains why the native CPPLib.dll can't be installed to a C# project.
Then I tried to move the CPPLib.dll into "content" folder in the package like this
content
-- CPPLib.dll
lib
-- DotNetWrapper.dll
Then the package can be installed, but the project will not build as DotNetWrapper.dll can not find CPPLib.dll in the same folder.
How can I get around this issue? Is it possible to somehow put everything in lib folder and only "expose" DotNetWrapper.dll from the package?