unity-game-enginevisual-studio-codeomnisharp

Omnisharp error about dotnet version - Unity


at VSCode launch today I'm receiving this error:

Starting OmniSharp server at 27/5/2022, 12:37:25
    Target: f:\UnityProjects\MyGame.sln
[ERROR] Error: Found dotnet version 5.0.407. Minimum required version is 6.0.100.

I read that there have been updates in omnisharp but I really don't know how to fix the issue. I've installed dotnet 6.0 TLS through a new visual studio installation... is there anything else I can do to bring dotnet working with my Unity project?


Solution

  • If you're using C# extension 1.25.0 or higher, they announced a change in the extension's details page:

    .NET Framework builds of OmniSharp no longer ship with Mono or the MSBuild tooling (See announcement omnisharp-roslyn#2339). To ensure that the C# extension remains usable out of the box for .NET SDK projects, we have changed the default value of omnisharp.useModernNet to true.

    If you still need Unity or .NET Framework support, you can set omnisharp.useModernNet to false in your VS Code settings and restart OmniSharp.

    Changing that omnisharp.useModernNet setting to false worked for me.