-
Notifications
You must be signed in to change notification settings - Fork 1.4k
How to fix OmniSharp broken in dotnet 3.1 image #1474
Comments
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 |
@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.... |
@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". Managed to get it to workI 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 (#1474 (comment)) 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)Notes
This appears to be due to a breaking change in the latest OmniSharp release which will require compensating changes in either the image or the template: dotnet/vscode-csharp#5120 (comment)
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.The text was updated successfully, but these errors were encountered: