Reputation: 1
I am new and have a little bit knowledge in Linux. That's said, let me summarize my problem. I have a big application which is written in winforms and i want it to run on ubuntu. I used mono but after running mono migration analyzer, P/invoke was not migrated so i used wine to run the application.
With wine, most of the part in the application worked fine but crashes on many occasion and the performance is also slow. I send the message to their forum but it was not resolved as seen here
After wine, i tried to see the possible platform to run the application on ubuntu. One of them to use Avalonia UI for the front end and C# code will be reused. So i created a prototype to see if the application crashes or throw any exception. It shows the DLLNotFoundException which after contacting the AvaloniaUI support point out that dll only worked on windows platform as indicated here
Now i searched out the solution but most of them telling me to use wine or mono, some old solution were telling me to use gcc as indicated here and here but gcc only compile c and C++.
Can someone guide me what to do here.
Upvotes: 0
Views: 492
Reputation: 946
I have looked at screenshot at your comment.
Your problem does not relate Avalonia, because Avalonia is UI framework, and you are invoking Networking routines, such as NetApiBufferFree(IntPtr buf).
I suppose, that you may need to look answer for a question "How to list all computers in local network in cross-platform way".
I think that you may need to split your solution to separate projects:
First one is for interface, its target is an application,
Second one should contain your logic for Windows, with code like this: https://morgantechspace.com/2014/04/get-list-of-network-computer-names-in-c-sharp.html#Get-Network-PC-Names ;
Third one may contain your calls to Linux-specific routines; There you should check how to call Linux system routines on C#. There is less info on this subject, but I'd start here: Get list of devices on LAN in C .
A first project should depend on second and third.
Obviously, your solution should target .NET Core; or Mono.
Upvotes: 1