在 MSVS 中找不到 C++/CLI DLL 命名空间
总体而言:我想要完成的是用 C# 和 C++ 编写代码,以实现良好的性能/生产力平衡。这不是出于代码重用的原因;我只是希望能够在适合我的时候用本机 C++ 编写新代码,而不必承受其所有的恐怖。
我有一个包含 4 个项目的解决方案:
- GUI:C# WPF 接口
- Logic_Cs:C# DLL,游戏逻辑的高级参考实现
- Logic_CLI:CLI DLL,托管和非托管代码之间的接口
- Logic_Cpp:具有本机实现的 C++ lib
在某些时候,所有这些工作得很好。在我的 GUI 项目中,我只需使用相应 DLL 中的命名空间即可在 C#/C++ 实现之间切换。
然后我显然改变了一些东西,现在我无法让 Logic_CLI 项目中的命名空间在 GUI 项目中被识别,即使 Logic_Cs 命名空间仍然工作得很好。
是的,我添加了正确的引用,设置了依赖关系,重建并从头开始重新创建了我的整个解决方案结构;没有任何帮助。
我注意到 C# DLL 构建到其自己的项目目录中的一个文件夹,而 CLI 构建到解决方案目录;但 GUI 应用程序似乎无论如何都会在正确的目录中查找 DLL,并且我没有收到任何有关 DLL 的投诉;它只是拒绝从中导入名称空间。
早些时候,当所有这些都起作用时,我没有显式地从 CLI DLL 中导出任何内容;我也不是为了 C# DLL 这样做。它应该“正常工作”,不是吗?
The big picture: what I am trying to accomplish is writing code in both C# and C++, to strike a good performance/productivity balance. It is not for code reuse reasons; I just want to be able to write new code in native C++ when it suits me, without committing to all its horrors.
I have a solution with 4 projects:
- GUI: C# WPF interface
- Logic_Cs: C# DLL, high level reference implementation of game logic
- Logic_CLI: CLI DLL, interface between managed and unmanaged code
- Logic_Cpp: C++ lib with native implementation
At some point, all of this was working just fine. In my GUI project I could switch between C#/C++ implementation merely by using the namespace from the appropriate DLL.
Then I apparently changed something, and now I can not get the namespace in the Logic_CLI project to be recognized in the GUI project, even though the Logic_Cs namespace still works just fine.
Yes, I added correct references, set dependencies, rebuilt AND recreated my entire solution structure from scratch; nothing helps.
I notice the C# DLL builds to a folder in its own project directory, while CLI builds to the solution directory; but the GUI application seems to look for the DLL's in their correct directory anyway, and im not getting any complaints about the DLL; it just refuses to import the namespace from it.
Earlier, when all this was working, I wasnt explicitly exporting anything from the CLI DLL; nor am I doing so for the C# DLL. It should 'just work', no?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论