How to merge managed and unmanaged dll into one dll
How to merge managed and unmanaged dll into one dll?
I want to merge two dlls in a single one. One is a c# managed dll, the other is a wrapped c++ managed dll with unmanaged c++ code.
I have used ILMerge but it does not support unmanaged dll.
And I have tested another commercial tool "Salamander .NET Linker", it does not support the unmanaged dll either. Someone even told me that it is not possible to merge managed and unmanged dll into one dll.
Does anyboby know how to do this?
Any advices are appreciated.
Mike GPosted Oct 10, 2017, 11:30 AM
ken duPosted Jul 27, 2007, 9:08 PM
AlanPosted Jul 27, 2007, 11:35 AM
Even if you could figure it out, the CLR might refuse to run it if it sensed that the managed code was generated in part by the C# compiler.
If you're trying to do this so that you can just package everything together, then I'd have thought that a better approach would be to include the C++ mixed mode dll as a resource within the C# dll and then to include code in the latter (perhaps a static Initialize() method which the user has to call) to stream the dll to disk.