-1

I want to port an application written in C#. NET (which run on Windows) in linux. the first solution that I thought is to use Mono. I try to used Mono Migration Analyzer MoMa and the errors are the plateform invokation. The applications calls Win32 Native Function like kerne32.dll and I want to know if there is any equivalent in Linux; any shared library which can implement the same stuff.

I see the mono documentation about this topic: http://www.mono-project.com/docs/advanced/pinvoke/

I also check these questions:

How to write programs in C# .NET, to run them on Linux/Wine/Mono?

What would be the equivalent of Win32 API in linux?

But I didn't find my answere.

PS: excuse my english.

Community
  • 1
  • 1

1 Answers1

0

If your Windows application is directly calling system APIs, then there will be no direct translation to Linux. The system library on Windows is completely different from that on Linux. Clearly there is a huge amount of common functionality and capability, but it is all exposed in a different way, bespoke to each platform.

You are going to need to dig into the current code and work out how to translate it. The best case scenario will be to take the existing code and convert it to use .net framework functionality. If you can do that for all the system p/invokes then you have a chance of sharing much more code between the two platforms. That way allows you to push onto the .net framework the task of managing the differences between the platforms. If you cannot use .net framework, and have to resort to p/invokes, then you are going to need bespoke code for each platform.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490