Open jkeech opened 2 years ago
Either we should include a newer .NET 6 SDK on all versions of the .NET devcontainer images in order to allow OmniSharp to work, or we should add a setting for .NET versions <6 to set "omnisharp.useModernNet": false to workaround.
Either makes sense to me. We'd probably want to update the images themselves longer-term (option 1), in case folks are accessing them directly beyond this template?
Any idea how I can fix temporarily meanwhile waiting for the fix it?
Root-cause:
After the release of OmniSharp v1.25.0, the extension no longer ships with an included Mono & MSBuild tools. This means you need the tools in your local machine to run the extension.
There are two fixes:
[Option 1] A workaround by downgrading the OmniSharp extension version, which I do not recommend!
[Option 2] Setup omnisharp.useModernNet setting to false and:
I've tested both solutions and both worked. Again I highly recommend the second one.
Hello everyone. I fixed it, but it's temporary.
in the vscode setting I turn off useModernNet like @jkeech mentioned in the main comment and I need to download mono in my computer, and set MonoPath/Library/Frameworks/Mono.framework/Versions/Current/
@gcamou This indeed did it for me too! I'm so happy this thread has been created about this problem because I started having issues with this problem yesterday and could not explain why the f*** this happened now.... Thanks a lot guys!
@sergiocyklpoint tysm the second solution worked for me!
Same here.
Installing a previous extension version does not work either => "Not compatible with my current version of vscode". Gonna have to install mono :/ MONO? Looks like C# is a second class citizen in vscode :/
I use devContainers and this is my dockerfile
ARG VARIANT="3.1"
FROM mcr.microsoft.com/vscode/devcontainers/dotnet:${VARIANT}
RUN groupadd docker
RUN usermod -aG docker vscode
# This fixes dotnet test breaking tty
RUN touch ~/.bashrc
RUN echo ' \n\
dotnet () \n\
{ \n\
local RET_VAL; \n\
local BEFORE=$(stty -g); \n\
$(which dotnet) "$@"; \n\
RET_VAL=$?; \n\
sleep 0.33; \n\
stty "${BEFORE}"; \n\
return $RET_VAL \n\
} ' >> /home/vscode/.bashrc
# This fixes omnisharp
RUN apt-get install gnupg ca-certificates
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
RUN echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | tee /etc/apt/sources.list.d/mono-official-stable.list
RUN apt-get update -y
RUN apt-get install mono-devel -y
Plus this setting: "omnisharp.useModernNet": false
Updated the title of this issue so that it's reflected as the issue users can review for workarounds if they encounter this. Please see the comments above (https://github.com/microsoft/vscode-dev-containers/issues/1474#issuecomment-1138768231) for how to address this.
Steps to Reproduce:
Program.cs
after the C# extension is installed (the extension might require a reload to fully activate)[ERROR] Error: Found dotnet version 3.1.419. Minimum required version is 6.0.100.