Reputation: 1243
From what i know writing a DLL in C# that exports C-Style functions that can be loaded from a native application written in a language like C or C++ is not directly possible due to the nature of language (IL, JIT Compiler). The only information incould find about achieving such a thing involved COM or some C++/CLI glue code.
However the official Microsoft Documentation says the following about .NetNative:
NET Native uses the same back end as the C++ compiler, which is optimized for static precompilation scenarios.
Does this mean writing a native DLL is possible using .Netnative? And if yes, how?
Upvotes: 0
Views: 158
Reputation: 89051
Does this mean writing a native DLL is possible using .Netnative?
No. The problem that COM Interop and C++/CLI solve is that there's no way to express a C/C++ compatible function export with C#. Both of them allow you to do that and to marshal data from .NET types to C/C++ types.
And .NET Native compiles whole apps, not individual libraries.
Upvotes: 2