Search code examples
.netlinuxmono

How do I know which version of .NET mono is using?


I've been tasked to create an application using mono/.NET 4.7.2 on linux.

I've had some experience with .NET Core but I've never used mono before. So I installed mono on a machine running Ubuntu 20.04 but I cannot find the dotnet version that it will be used (since I must use 4.7.2).

  1. Does it uses my allready existant .NET 5?
  2. How can I check the version of .NET that will be used by mono?
  3. More importantly, how can I force to use that specific, 4.7.2, version?

No info from mono --version or csc.


Solution

  • Mono is an implementation of .NET.

    Lets re-phrase that: Mono is a .NET implementation. It doesn't use an external .NET implementation, it is a .NET implementation.

    Mono wont use .NET Core, or .NET 5. Those are separate implementations and runtimes for .NET. If you want to use .NET 5, install and use .NET 5.

    Check the Mono releases page for information about Mono release versions and which .NET Framework release they match up to.

    For example, Mono 5.18.0 added suppport for .NET Framework 4.7.2 and Mono 6.6.0 added support for .NET 4.8. But please be aware that Mono won't be 100% compatible.

    It sounds like this might be the first time you are using Mono. If so, watch out. Mono is far from 100% compatible with .NET Framework. There are missing features, bugs, performance issues and so on. It works for many use-cases, but it's not really supported by Microsoft.