Writing .NET for Windows via Linux and Mono

For a long time now, I've largely developed using open source languages, toolkits, etc. on Linux and Mac. A new project, though, is about to shove me into the .NET world. Moreover, a .NET world whose products will be deployed to a Windows infrastructure.

In my mind, I made the assumption that I wouldn't be able to develop for this platform combination on Linux using Mono due to underlying architectural differences, but it's no more than an uninformed assumption at this point. Can someone can verify or debunk that assumption?

Thanks.


I think you can, only the other way (develop on windows with .NET and run on mono) is problematic, because of the lack of some library implementations in mono. However, you don't really gain anything from mono (and monodevelop, the IDE), unless you are an open-source enthuasist. (Also, there are some concerns about the openness of these tools among the open source community).


The framework should abstract you from the platform differences and I believe Mono produces MSIL code so there's no reason you can't develop for Windows on Linux or a Mac.

I would just be aware that the Mono framework isn't up-to-date but it's pretty good from what I've seen.

I should also add that I've not tried this myself but I don't believe there's a barrier to stop you.

Remember that the CSC (C# Compiler is free (part of the Windows SDK) as are the Visual Studio Express editions and also SharpDevelop (also OSS)) so lots of options for you.


I think the answer is a little more nuanced than that. You can think of Linux/Mono as a .NET target platform, just like Windows XP with .NET 2.0, Windows Vista with .NET 3.5, etc. Depending on what you want to do, it can be entirely possible to develop .NET code that is compatible with multiple platforms.

When Microsoft submitted .NET to ECMA as a standard, the submitted a subset (called the CLS, common language specification) of what they provide to developers. To give one important example, Windows graphics (Forms, ASP.NET, etc.) isn't a part of the CLS. However, Mono does now support Windows forms 2.0, but it wasn't until relatively recently.

So, basically, you've got to pay close attention to what features you need, and if you like living on the cutting edge of Windows technologies, you're going to be locked out of using Mono. However, if you have the ability to pick which libraries and language features you want to use, you could, if you chose, select a set that is fully supported on Mono, and do much of your work that way.

Testing, of course, is another issue...since you've got completely different implementations, you're still going to need to do a lot of testing on Windows. Remember, Java's design goal was platform independence, but .NET's was language independence, NOT platform independence. So, you would be heading into trecherous waters...

链接地址: http://www.djcxy.com/p/52210.html

上一篇: Mono中的System.Data

下一篇: 通过Linux和Mono编写.NET for Windows