How do I reference a Native Dll project in a managed C# project in same solution?

Both projects are in the same solution. I added the native project as a project reference but the native dll doesn't seem to be copied to output directory of c# project because my LibraryImports cannot find it.
4 Replies
nathanAjacobs
nathanAjacobsOP3d ago
No description
No description
sibber
sibber3d ago
you dont create a build task that copies the dll to the c# project's output dir and specify
[DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory)]
[DefaultDllImportSearchPaths(DllImportSearchPath.AssemblyDirectory)]
nathanAjacobs
nathanAjacobsOP2d ago
GitHub
msbuild doesn't copy c++ referenced content file into c# output dir...
Steps to reproduce one solution including: one c# project one c++ project x64 solution configuration, including c++ as x64, and c# as Any Cpu (or x64 - doesn't matter) in the csproj file add: &...
sibber
sibber2d ago
huh so its supposed to work i just assumed it wasnt when i tried good to know

Did you find this page helpful?