将本机DLL和程序集合到一个DLL中 [英] Combine native DLL and assembly into a single DLL
问题描述
本来我打算使用C ++ / CLI来创建一个包含本机C ++类的代码,但是我发现它会导致一个2〜4倍减速。
所以我决定将我的本地C ++编译成DLL,并通过 P / Invoke 。我将在C#中执行数据预处理,并在本机DLL中进行数字处理。
问题是,当我提供我的工作供别人使用时,我希望它是一个DLL。
这可能吗? BTW,我有本机C ++的所有源代码。
您可以在.NET中混合使用同一程序集中的语言,但不能自然。
请参阅:
我把不同语言的程序集分开。
I am currently programming in C++ and C#. Using native C++ for the numerical computing part.
Originally I intended to use C++/CLI to make a wrapper to the native C++ classes, but I found it would result in a 2 to 4 times slowdown.
So I decided to compile my native C++ to a DLL and call in .NET/C# via P/Invoke. I will do data preprocessing in C# and number crunching in the native DLL.
The problem is that when I deliver my work for others to use, I'd like it to be a single DLL.
Is this possible? BTW, I have all source code to the native C++.
You can mix languages in the same assembly in .NET but not naturally. I would avoid this unless absolutely necessary.
See:
I keep assemblies from different languages separate.
这篇关于将本机DLL和程序集合到一个DLL中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!