Reputation: 497
My bos, who is not a CS guy, asked me to develop a dll in c# for him. further investigation on my side reveal that the dll should be in cdecl conventions.
If I'll take this project it will be my first dll development.
browsing through google tell me this is possible, but before I tell the bos I can do it, I wanted to get your advice regarding this issue. (lets assume nor time or code-quality are the main issue, but it needs to be done)
Any comments regarding such possibility would be much appreciated.
Upvotes: 0
Views: 188
Reputation: 612794
It sounds like you are looking for unmanaged function exports. There's no out-of-the box way to achieve that in C#. You can use Robert Giesecke's Unmanaged Exports. This performs some magic during compilation to modify the emitted IL to allow unmanaged exports.
The officially supported way to export unmanaged functions from a .net DLL is to make a mixed mode C++/CLI assembly.
Yet another way to export your functionality to unmanaged code is to expose a COM server from your C# code.
Upvotes: 1