Accessing C# DLL from Xojo

Hello Everyone,

i am working on Xojo for 1 months for the new solution to my company Desktop Application.

I am evaluating Xojo for our needs in every aspects.

Now, I am trying to access C# DLL from XOJO Tool but i am not able to find any success from the old solutions mention in this forum.
I wonder if anyone have update on this that, how can we access C# DLL from Xojo ?
which means basically; accessing C# methods.

[quote=458161:@Ammad Ahmed]Hello Everyone,

i am working on Xojo for 1 months for the new solution to my company Desktop Application.

I am evaluating Xojo for our needs in every aspects.

Now, I am trying to access C# DLL from XOJO Tool but i am not able to find any success from the old solutions mention in this forum.
I wonder if anyone have update on this that, how can we access C# DLL from Xojo ?
which means basically; accessing C# methods.[/quote]
I think you have to expose either a COM or C interface. I have never tried it but I have a feeling that DLLs built using managed code such as C# cannot be accessed.

@Ammad Ahmed

Yes you can create a C# DLL and use it in Xojo, and it is more complicated than using a C++ DLL:

C# Unmanged Exports

The secret is that the DLL must be translated to C code, otherwise the naming convention gets mangled.

As an alternative, here is how to create a DLL in C++ on my blog that can be used in Xojo 2019 r1.1 (not sure what it will do in Xojo 2019 r2):

Create a Raw C DLL for Xojo

Here is the GitHub link for the code:

GitHub RawPlugin

@Eugene Dakin Thank you very much for you answer.
I want to use C# DLL because we want to have solutions as C# methods, so we can call it from Xojo by passing parameters and performing task in C# DLL.
Example: Like passing barcode number from Xojo and then generating barcode from C# DLL.

I will look in to your above examples, and see how i can integrate it with Xojo to call unmanaged code.

This could help:
https://blog.xojo.com/2014/01/03/accessing-net-code-from-xojo/

Anyone try this with cross-platform .Net Core? Would love to have a C# crossplatform DLL library get called on from my mac

@Michel Bujardet Thank for your answer. Sorry i work as a student here so i am unable to work whole week, reason for replying late.

I applied your given solution but when i try to add reference in Xojo, instead of finding Class (XojoTest.cs), i was only able to find whole project (XojoTestProject) and the Dll is also been created of XojoTestProject.dll

I don’t know what am i doing wrong, but i am stuck here, and couldnt find the solution for this.