My question is similar to this one and this one, but there is a slight difference. So that's why I am asking it here.
I have a shiny .Net 3.5 Windows Service ( with NHibernate, LINQ, lambda expression) etc, running on Windows. Now I plan to port my app to Linux, so I am thinking about Mono.
Can I just compile my .net app in Windows, and copy it to a Linux machine with .Net ( mono version) installed, and expect it to run smoothly? If not, is there anything I should do?
Any answers or pointers are welcome.
The runtime should be fine but you can run the Mono Migration Analyzer.
Will it just work? You really have to test it. I've just recently put effort into making Protocol Buffers work on Mono. I've had very little execution-time trouble so far; the compiler was more of an issue for me. However, I've had to temporarily disable one of the unit tests (using mocking) because it makes the Mono 2.4 VM itself go bang. I haven't investigated why yet, but that sort of thing is basically impossible to predict.
Anything which uses "deep" aspects of the CLR - such as expression trees and dynamic methods - is likely to have more problems than simple libraries, IMO.
Now, you say it's a Windows service - obviously Linux doesn't have services in quite the same way as Windows, so you'll need to work out how you want it to run. I'd start off by running it as a simple console app if I were you... once it's all working, you can think about integrating it with other "service" controllers etc - if you find you need to.
It certainly used to be the case that
xbuild
didn't provide a seamless migration path from building on Windows to building on Linux... however, it's had a lot of attention recently, so it's worth trying again...Start by using the MoMA tool
From Personal point: All C# 3.0 feature are supported well, I had no problem with LINQ (To Objects, don't know about LINQ to SQL or to XML) and NHiberinate also works well (although I didn't end up using in)