I have a .Net Standard project which references a C++ dll
For now I'm using DllImport to get it to work.
I want to create a Nuget package which ships with the relevant dlls for all targets.
I presume I'll have to build the C++ library for all targets (Windows x64, Windows x86, Linux, etc). Fine.
Now I need to somehow package them all up in a nuget package, and I am unsure how to do this)
How to add C++ library in a .NET Core project is similiar, but the answer is not correct for .Net Standard projects, which have a new style csproj, and use the dotnet cli rather than the nuget cli. Also it doesn't explain how this works with multiple targets.
Also, do I keep my DllImports, or do i need to change them? For now I'm using the absolute file-path of the dll as so:
internal const string DLL = "D:\\filepath\\mydll.dll";
[DllImport(DLL)]
internal static extern int MyMethod();