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


you dont
create a build task that copies the dll to the c# project's output dir
and specify
https://github.com/dotnet/msbuild/issues/2823#:~:text=%3CProjectReference%20Include%3D%22..%5CMyVcx,CopyToOutputDirectory%3E%0A%20%20%20%20%3C/Content%3E%0A%20%20%3C/ItemGroup%3E
This seems to work, although I'm unsure why specifying those items in the native project makes it work
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: &...
huh so its supposed to work
i just assumed it wasnt when i tried
good to know