I have c++ native dll, lib and headers file. After I reference lib from c++\cli project, it builds successfully, but since c++\cli project - just a wrapper, I reference it in c# project and no native dll appears in c# project output directory after build. How can I fix it? I would not like to use build event to copy dll`s manually.
1
votes
downvote, along with comments would be much more useful to me
– Shishkin Pavel
I didn't downvote but I suppose you didn't search a lot... Add the native dll to the C# project as a "Content" build action, along with "Copy to output directory" set to true.
– Lucas Trzesniewski
@LucasTrzesniewski using "copy always", as well as using build events works only if i use wrapper in my own projects. If I need to give this library, depending on wrapper, to someone, they must know about adding some dll`s to "Content" or changing build actions. Thus, this idea does not seem attractive to me.
– Shishkin Pavel
You have to document your dependency anyway (plus your dependency to the C++ runtime redistributable), so I don't think this should be a problem.
– Lucas Trzesniewski