1

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

1
  • Not an "exact duplicate" - but only because of the mistaken assumption that recompilation is needed. Commented Apr 29, 2009 at 6:55

4 Answers 4

5

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 "\".

Sign up to request clarification or add additional context in comments.

1 Comment

Moreover on the directory separator, a backslash is a valid character in a file name on Linux, whereas windows converts forwards slashes to back slashes. Also, in windows, my understanding is that file names are case-insensitive
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.

Comments

0

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

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.