且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何用C#.NET程序,在Linux /酒/单声道运行它们?

更新时间:2023-10-20 23:28:04

你有没有了解Mono.NET在 HTTP://www.mono -project.com

它可以让你写的.NET应用程序在Linux拥有微软实现的微小差别。 我不认为将酒应付任何.NET组件。

刚刚看了面前的文件,你一展身手。

PS:这个也给你单声道和.NET之间的兼容性列表。 http://www.mono-project.com/Compatibility 和的MoMA(mono迁移分析仪)是,将扫描已经创建如果兼容,看看在Linux上部署任何.NET应用程序的工具。

In this particular case I need to run .complicated NET application for Linux. By complicated i mean - that project was developed for 3 years and i don't want to write it again in java or something else and develop and support both, .NET and Java version later.

Application is generating mouse and keyboard events (by winapi/dll import) and uses serial port. I have also few timers for delays - for serial port communication (10-20ms, i dont need big precision here).

The rest is just a lot of simple code, nothing special, no weird controls, no directx etc.

What should i expect? Will this work?

If some part of code will fail - i can change it a little, make network connection between .net app and mini-application on linux that i can write for sending mouse and keyboard events, or RS232 communication.

Additionally i want to ask about Wine and .NET in general:

How to write .NET applications that should run on Linux/Wine/Mono?

  • which version of framework? (1.x, 2.0 or can i use 3.5?)
  • what should i avoid (imports from windows dll? timers?)

Edit/moved from comment:

I saw mono few years ago, but it was terrible. Now i see it growed up, supports LINQ, Threading and other complicated features. In addition now help looks really serious. Im not accepting answer yet, because i see that people still posting very useful links. If this question gets many +1 i will rewrite it and maybe this will help others.

I hope someone here have some practical experience with .NET on linux here...

Have you read about Mono.NET on http://www.mono-project.com?

It allows you to write .NET apps for Linux with minor differences over the Microsoft implementation. I don't think wine will cope with any of the .NET components.

Just read the documentation before and you have a go.

PS: This also gives you the compatibility list between mono and .NET. http://www.mono-project.com/Compatibility and MoMA(mono migration analyzer) is a tool that will scan any .NET app already created to see if its compatible to deploy on linux.