简体   繁体   中英

Will a C# program for Windows run in Ubuntu under Mono without modification?

i want to write a tcp server in c# under windows. can i run the same program or use the same code under mono without modification.

You have to be careful with what you write. Mono isn't near 100% supporting .NET on Windows, but it's a very good start. a TCP server might be tricky because it tends to be the places that do hardware interaction (like IO) that have the most compatibility issues.

Mono has a free tool called MoMA that can analyze a .NET Application and tell you if it is going to have problems. You can download it here: http://www.mono-project.com/MoMA

I would suggest developing the application under Linux/Mono, then checking that it works on Windows. You're less likely to encounter issues that way.

Generally speaking it should work if you aren't using OS specific actions. Miguel made a damn good job with Mono and you'll find it's very easy to work with.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM