0

Duplicate: Run .NET exe in linux

Hello,

Is it possible to make my existing Windows Forms Application made using Visual Studio 2008 and .Net framework 2.0 run on Linux by recompiling in Linux with less/No code changes?

Thanks

Community
  • 1
  • 1
Josh
  • 13,530
  • 29
  • 114
  • 159
  • Not an "exact duplicate" - but only because of the mistaken assumption that recompilation is needed. – MSalters Apr 29 '09 at 06:55

4 Answers4

4

very possible, however, depending on your application your mileage may vary. no-nos include third party libraries/DLLs that depend on COM and Win32 calls, and P/Invokes. you may also have to watch out for code that does file/directory concatenation, as unix uses "/" as directory separator while Windows uses "\".

cruizer
  • 6,103
  • 2
  • 27
  • 34
1

I suggest you recompile the same code in the Mono IDE, and by making any minor alterations that may be required. I've done this many times.

jay_t55
  • 11,362
  • 28
  • 103
  • 174
0

You may pick up some info here: Run .NET exe in linux

Community
  • 1
  • 1
Fredrik Mörk
  • 155,851
  • 29
  • 291
  • 343
0

yeah you can, last I checked, their DataGridView is improving, it can hide columns now, however their VirtualMode on dgv isn't working yet.

I use Mono mostly for Remoting stuff, the DateTime type are now Remoting-compatible(yipee!) in Mono 2.4. before (in 1.9), I have to cast my datetime fields to string so it can be transported from and to Remoting middle-tier, this is not needed anymore in 2.4.

Use this guideline for writing portable software: http://mono-project.com/Guidelines:Application_Portability

an example:

To write portable software, you must make sure that you use the System.IO.Path.DirectorySeparatorChar (http:/monodoc/P:System.IO.Path.DirectorySeparatorChar) character when you must concatenate paths, or even better, use the System.IO.Path.Combine (http:/monodoc/M:System.IO.Path.Combine(string,string)) method to combine pathnames.

Michael Buen
  • 38,643
  • 9
  • 94
  • 118