VS Solution with C# project dependant on C project, best pratice

I have two projects with the full source code, one in C# and the other in C in one VS 2012 solution. The C# code is calling the C .dll via PInvoke. I set the dependency on the solution level to tell the solution to build the C project before it builds the C# project. Ideally, I would like to have the generated C .dll next to my executing C# dll, so I would refer to it by its naked name from my `DllImport`. However, this is not easy given that another project that is using my C# project will not copy the C .dll across. This problem would not exist if all my projects are .NET as MS Build will copy the .dll to the host. > Are there any best practices or a magical VS option, that I am missing, > to make the C .dll gets copied across in the same way that other > .NET assemblies do? This question is marked as a duplicate but it is not. The question referred to: - It is talking about 3rd party .dlls, this one is about own project within the same solution. - The accepted answer to that question doesn't take into consideration copying debug to debug and release to release. - The accepted answer doesn't show how to copy through a chain of dependencies (C# -> C# -> C ). I just found a solution which was inspired by https://stackoverflow.com/a/13944692/157017 which solves this specific situation. Always
Thank you. While some of the answers to that question apply to this question, but the question itself is asking about 3rd party dlls and not own project within the same solution.

以上就是VS Solution with C# project dependant on C project, best pratice的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏