-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Omnisharp Server crashing with a NullReferenceException #2125
Comments
It crashes on that line, but I'd say that crash can only happen if we have a It would be good to have the repro project. |
@BeminAbe are you able to provide a repro project for this? |
As of right now I don't have a repro project. Are there any tools/settings I can use that may help me with making one? |
Was running in a Blazor web project if it helps |
@NTaylorMullen Which version of dotnet were you running? |
6.0.0-preview.2.21118.6 |
Same problem in a vanilla ASP.NET Core MVC template, repro attached: Open any C# file, and OmniSharp crashes with the same stack trace as others have got above |
Me too. Tried that NRE patch but still crashes with the similar stacktrace. I will update this post later to provide the full stacktrace. |
Not a 100% solution, but a temp workaround for me to at least temporarily prevent the crashing was to replace this line with It's not a 100% solution, since it doesn't address the root of the issue, and an error is still logged in the console (though, it's gracefully handled), but the patch at least prevented it from crashing all the time and being generally unusable with the latest preview versions of .NET 6. |
Another tempfix that will stop Omnisharp from crashing just after opening This issue is happening for When it's calling this line
where This code will respond with omnisharp-roslyn/src/OmniSharp.Roslyn/OmniSharpWorkspace.cs Lines 339 to 344 in 9c293cb
|
Adding a reference repository and explanation on how to replicate the issue found in README https://github.com/jsheely/dotnet6-omni-bug1 This bug does not appear to happen in dotnet 5. It's something specific to dotnet core 6. Including the latest preview 7 release |
happened to me yesterday. Everything was working perfectly fine from the very beginning -I started the .NET project in VS Code-. It happened when I deleted a couple of extensions, and reloaded the project, for whatever reason Omnisharp didnt like that. I could never fix it afterwards, had to load the .csproj file in Visual Studio 2022 Preview and continue to work from there. I like VS very much but I prefer Visual Studio Code. |
@laxedo17 Since your issue could have a different root cause, could you please open a new issue and share all the requested logs? |
Having exactly th same issue. It happens at random moments for example when adding modifiers to class members or when moving or copy code lines.
|
Maybe related suddenly i am getting this one:
|
@mikechari not related. remove "omnisharp.path":"latest" from your settings, as that opts you into the latest prerelease of OmniSharp which contains a regression |
Issue Description
Omnisharp keeps throwing a NullReferenceException only when opening a c# file in our Client Project.
Our workspace is a blazorwasm application split into multiple Projects Client, Server, Shared and Core.
Steps to Reproduce
As of right now I haven't found any.
Expected Behavior
O# Server not crashing.
Actual Behavior
O# Server crashing due to NullReferenceException.
Logs
OmniSharp log
Environment information
VSCode version: 1.55.0
C# Extension: 1.23.9
Dotnet Information
.NET SDK (reflecting any global.json): Version: 6.0.100-preview.2.21155.3 Commit: 1a9103db2dRuntime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.100-preview.2.21155.3\
Host (useful for support):
Version: 6.0.0-preview.2.21154.6
Commit: 3eaf1f316b
.NET SDKs installed:
6.0.100-preview.2.21155.3 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0-preview.2.21154.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0-preview.2.21154.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.0-preview.2.21154.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Visual Studio Code Extensions
The text was updated successfully, but these errors were encountered: