Sunday, March 9, 2014

Dotnet on Linux using Mono

I had a function with no counterpoint in Linux that I wanted to run, something that returns just the last few digits of a very large number.  There was a function in a Windows Numerics library that did the trick.

When I first tried to compile the program it complained that it couldn't find the Numerics.dll, so I had to use the Ubuntu Software Center to install "libmono-system-numerics4.0-cil".

After that I had to figure out where it put the file I needed:
locate System.Numerics.dll
And finally I was able to compile and run the program:
 gmcs -r:/usr/lib/mono/4.0/System.Numerics.dll Test.cs  
./Test.exe 
It did the trick.  Now I am ready to try to do larger projects using C# and dotnet on Linux.

Here is a link to an example of a hello world program: http://www.mono-project.com/Mono_Basics

No comments:

Post a Comment