C# – Performance: Compile in VS, Run in Mono on Windows and Linux

clinuxmononetperformance

I have the following questions:

  1. Is it possible to compile a C# project using VS.NET, and run it on mono?
  2. Are there any performance benefits associated with approach 1 (vs compiling with the mono compiler)?
  3. What about running the output .exe/.dll on linux? And what are the associated performance characteristics?

Thanks

Best Answer

  1. Yes, you can do that. It should work unless the code uses some framework elements that are not implemented on mono.

  2. Not that I am aware of.

  3. Not sure what the difference between #3 and #1 is. If you are referring to using mono to compile on Windows, then porting it to linux, it should still work the same. Both compilers generate essentially the same IL code.