-1

In C# project, I want to use a C++ .dll by using nuget package manager. Is it possible and how? An example project will be appreciated.

cppTestLIB.dll is packaged using CoApp (http://coapp.org/)

When I install this package from C# project, it gives below error.

Could not install package 'cppTestLIB 1.0.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

user1766006
  • 177
  • 1
  • 14
  • What happened when you tried? Did you encounter any problems? What part of the guides that pop up when you googled "nuget C++" are you stuck with? – nvoigt Feb 19 '16 at 14:41
  • I've updated my question – user1766006 Feb 24 '16 at 12:01
  • Possible duplicate of [Automatic native and managed DLLs extracting from Nuget Package](https://stackoverflow.com/questions/40104838/automatic-native-and-managed-dlls-extracting-from-nuget-package) – Liam Jan 10 '19 at 17:08

1 Answers1

1

I've solved my problem by not putting non-.NET DLL to lib folder. I've not used CoApp tool.

Just by adding such a line to .nuspec file,

  <file src="native.dll" target="binaries\native.dll" />

c++ dll is packaged and it can be used from C# project.

user1766006
  • 177
  • 1
  • 14