question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Intellisense (omnisharp) crashes after typing.

See original GitHub issue

I posted this in the Visual Studio Code issues and they told me to post it here saying that it’s the C# extension’s issue. I basically try to use Intellisense and it crashes. I can use it for 1 second and then it crashes every time, giving me this error: “Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.” This error happens in every project & every script. I have already done an uninstall and reinstall. I have also tried different versions of Visual Studio Code. I have also tried 3 different versions of the C# extension.

I have also used the most recent version, and neither work (currently reverted to 1.23 to see if that fixed it, but nope).

This is my entire error log:

Starting OmniSharp server at 1/21/2022, 4:57:14 PM Target: c:\Users\nicep\Documents\Game Projects\Legend-Maker\Legend Maker\Legend Maker.sln

OmniSharp server started. Path: c:\Users\nicep.vscode\extensions\ms-dotnettools.csharp-1.23.17.omnisharp\1.38.1-beta.44\OmniSharp.exe PID: 9444

    Starting OmniSharp on Windows 6.2.9200.0 (x64)
    Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
    Using the 'dotnet' on the PATH.
    DotNetPath set to dotnet
    Located 1 MSBuild instance(s)
        1: StandAlone 17.0.0 - "c:\Users\nicep\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.38.1-beta.44\.msbuild\Current\Bin"
    MSBUILD_EXE_PATH environment variable set to 'c:\Users\nicep\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.38.1-beta.44\.msbuild\Current\Bin\MSBuild.exe'
    Registered MSBuild instance: StandAlone 17.0.0 - "c:\Users\nicep\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.38.1-beta.44\.msbuild\Current\Bin"
        CscToolExe = csc.exe
        CscToolPath = c:\Users\nicep\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.38.1-beta.44\.msbuild\Current\Bin\Roslyn
        MSBuildExtensionsPath = c:\Users\nicep\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.38.1-beta.44\.msbuild
        MSBuildToolsPath = c:\Users\nicep\.vscode\extensions\ms-dotnettools.csharp-1.23.17\.omnisharp\1.38.1-beta.44\.msbuild\Current\Bin
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
    Detecting Cake files in 'c:\Users\nicep\Documents\Game Projects\Legend-Maker\Legend Maker'.
    Did not find any Cake files
    Detecting projects in 'c:\Users\nicep\Documents\Game Projects\Legend-Maker\Legend Maker\Legend Maker.sln'.
    Queue project update for 'c:\Users\nicep\Documents\Game Projects\Legend-Maker\Legend Maker\Assembly-CSharp.csproj'
    Detecting CSX files in 'c:\Users\nicep\Documents\Game Projects\Legend-Maker\Legend Maker'.
    Did not find any CSX files
    Configuration finished.
    Omnisharp server running using Stdio at location 'c:\Users\nicep\Documents\Game Projects\Legend-Maker\Legend Maker' on host 15756.
    Loading project: c:\Users\nicep\Documents\Game Projects\Legend-Maker\Legend Maker\Assembly-CSharp.csproj
    Successfully loaded project file 'c:\Users\nicep\Documents\Game Projects\Legend-Maker\Legend Maker\Assembly-CSharp.csproj'.
    Adding project 'c:\Users\nicep\Documents\Game Projects\Legend-Maker\Legend Maker\Assembly-CSharp.csproj'
    Update project: Assembly-CSharp

Received response for /quickinfo but could not find request. Received response for /v2/getcodeactions but could not find request. Received response for /v2/blockstructure but could not find request. Received response for /v2/getcodeactions but could not find request.

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at OmniSharp.Helpers.DiagnosticExtensions.<>c.<DistinctDiagnosticLocationsByProject>b__2_0(DocumentDiagnostics x) in D:\a\1\s\src\OmniSharp.Roslyn.CSharp\Helpers\DiagnosticExtensions.cs:line 38 at System.Linq.Enumerable.<SelectManyIterator>d__233.MoveNext() at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Lookup2.Create[TSource](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer) at System.Linq.GroupedEnumerable3.GetEnumerator() at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext() at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType) at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType) at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer) at OmniSharp.Protocol.Packet.ToString() in D:\a\1\s\src\OmniSharp.Host\Protocol\Packet.cs:line 22 at System.IO.TextWriter.WriteLine(Object value) at System.IO.TextWriter.SyncTextWriter.WriteLine(Object value) at OmniSharp.Services.SharedTextWriter.ProcessWriteQueue() in D:\a\1\s\src\OmniSharp.Host\Services\SharedTextWriter.cs:line 48 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:21 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
GAGOSIAN84commented, Jan 22, 2022

Same here. Yesterday was fine, but it omnisharp crashes today. Jan/22

4reactions
JoeRobichcommented, Jan 23, 2022

@dreammixgames I see you have omnisharp.path set to latest in your configuration. If you remove that and restart, do you see the same issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode OmniSharp crashing on startup from UnityEngine. ...
My OmniSharp extension for VSCode is crashing on startup. I had everything working properly with intellisense and all but then I rebooted.
Read more >
omnisharp-vscode
To file a new issue to include all the related config information directly from vscode by entering the command pallette with Ctrl +...
Read more >
Language Server Extension Guide - Visual Studio Code
Let's build a simple Language Server extension that implements autocomplete and diagnostics for plain text files. We will also cover the syncing of ......
Read more >
How To Fix Unity's Auto Complete On The New VS Code On ...
Do this if your auto-complete for unity stopped working after updating VS Code to the latest version on Windows 10. This will work...
Read more >
How to set up Visual Studio Code for Unity - YouTube
Visual Studio Code is a source-code editor made by Microsoft for Windows, Linux and macOS. Features include support for debugging, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found