简体   繁体   English

c ++ \\ cli项目相关的c ++ dll未复制到c#输出目录

[英]c++\cli project dependent c++ dll not copied to c# output directory

I have c++ native dll, lib and headers file. 我有C ++本机dll,lib和标头文件。 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. 在我从c ++ \\ cli项目引用lib之后,它会成功构建,但是由于c ++ \\ cli项目-只是一个包装器,我在c#项目中引用了它,并且在构建后c#项目的输出目录中没有本机dll出现。 How can I fix it? 我该如何解决? I would not like to use build event to copy dll`s manually. 我不想使用构建事件来手动复制dll。

Thus, I have found only two possible solutions: 因此,我仅找到两种可能的解决方案:

  • post-build event in wrapper library, that copies native dll to all c# projects that require it 包装器库中的构建后事件,该事件将本机dll复制到所有需要它的c#项目中
  • add native dll in c# projects directly and set build action to "Copy to output directory" (in accordance with the Lucas response) 直接在c#项目中添加本机dll,并将构建操作设置为“复制到输出目录”(根据Lucas的响应)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM