Running .NET in Linux: Easier than I thought it would be

I like C#. Especially with the asynchronous syntax and the .NET Web API framework, writing REST APIs is great. I also really like running Linux servers: open source, easy set up and administration, security, and of course price.

So I went on a journey to get my .NET REST API service running on CentOS. It turns out I took the really long route, so hopefully this post will save people some time. The main false assumption I made was that you had to recompile the application with Mono to use it in Linux; the same way you would recompile a C++ program for Linux.

I’ll skip the technical details and jump right to the conclusion:┬áThis is not true! All I had to do was compile in Visual Studio as usual, copy the binaries over and run the executable with mono:

mono MyService.exe

And that is all there is to it! I love it when things like this happen.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.