Omnisharp does not seem to recognize my installed .NET sdk (version 6.0.408).
I have tried manually adding this path via settings to Omnisharp: SDK path i.e.:
C:Program Filesdotnetsdk6.0.403
I have also tried reinstalling the SDK and even VSCode.
This does not seem to solve the issue however, and I am unable to run my asp.net application on VSCode. Running dotnet run from the terminal is fine.
4
Answers
I had the same problem and just solved it. Copy and pasting this from a Youtube comment I just finished writing, so it might sound funny out of context, but the good bits are in there. Hope it helps.
Installed dotnet 7.0, but then it said dotnet 6 was missing…
So I deleted the script asset, exited Unity, went back to their website and installed Net 6.0.403
Error still happened.
I’ll note this seemed to push a script compiling error out to Unity in the inspector window, as well.
Deleted the script asset again, exited Unity again, then uninstalled both dotnet 7 and dotnet 6.
Then I reinstalled dotnet 6.
Into unity, made a new script, opened it, and this time no error message about missing net 6.
I just started yesterday. Literally. So if my solution is trash, I’ll laugh with you lol. Best of luck.
TLDR: Both .NET SDK versions and Visual Studion versions needed to be x64.
Here was the exact error I was seeing in the Output Window:
When I realized there was a mismatch between my .NET SDKs and Visual Studio Code in terms of being x86 and x64, I did the following:
Uninstalling and then installing the VSCode extension
C# for Visual Studio Code
solved the issue for me.You will also get this error if you are still running the 32-bit version of VS Code. While I thought I had updated my machines with the 64-bit version, I never got around to updating one machine. I uninstalled VS Code and reinstalled it, making sure I selected the 64-bit version. This addressed the, .NET 6 SDK for x86_64 was not found, error.