Skip to content
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

Regular NullReferenceException - what's the point of a tool that's BROKEN? #4746

Closed
logan-cy opened this issue Sep 6, 2021 · 3 comments
Closed

Comments

@logan-cy
Copy link

logan-cy commented Sep 6, 2021

Literally all I want to do is write some code but this backward ridiculous mess has other ideas.

I restart VSCode, load up my project and instantly get this:

    Target: c:\dev\st0821

OmniSharp server started.
    Path: c:\Users\redacted\.vscode\extensions\ms-dotnettools.csharp-1.23.15\.omnisharp\1.37.15\OmniSharp.exe
    PID: 22844

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 5 MSBuild instance(s)
            1: Visual Studio Build Tools 2017 15.9.28307.222 15.9.21 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
            2: Visual Studio Community 2022 17.0.31521.260 17.0.0 - "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin"
            3: Visual Studio Community 2017 15.9.28307.586 15.9.21 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin"
            4: Visual Studio Community 2019 16.8.30907.101 16.8.3 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
            5: StandAlone 17.0.0 - "c:\Users\logan\.vscode\extensions\ms-dotnettools.csharp-1.23.15\.omnisharp\1.37.15\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio Community 2022 17.0.31521.260 17.0.0 - "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin"
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in 'c:\dev\st0821'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in 'c:\dev\st0821'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'c:\dev\st0821\st0821.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'c:\dev\st0821'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location 'c:\dev\st0821' on host 3936.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: c:\dev\st0821\st0821.csproj
[info]: OmniSharp.OmniSharpWorkspace
        Miscellaneous file: c:\dev\st0821\Pages\Businesses\Index.cshtml.cs added to workspace
Received response for /completion but could not find request.
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file 'c:\dev\st0821\st0821.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project 'c:\dev\st0821\st0821.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: st0821

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at OmniSharp.Helpers.LocationExtensions.<>c.<GetQuickFix>b__0_2(Document document) in D:\a\1\s\src\OmniSharp.Roslyn.CSharp\Helpers\LocationExtensions.cs:line 40
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at OmniSharp.Helpers.LocationExtensions.GetQuickFix(Location location, OmniSharpWorkspace workspace) in D:\a\1\s\src\OmniSharp.Roslyn.CSharp\Helpers\LocationExtensions.cs:line 32
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Linq.Enumerable.<DistinctIterator>d__64`1.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__1.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()

If there's some update I need to run, I'd appreciate it if this stupid extension could tell me about rather that screwing up my evening like this...

@nohwnd
Copy link
Member

nohwnd commented Sep 7, 2021

Is your project open source? Or do you have a repro? There were some problems around this recently, and some were fixed, but I see you are on the latest version of the extension.

@logan-cy
Copy link
Author

logan-cy commented Sep 8, 2021

My project is a project... I don't understand the question. I started it with dotnet new web... Is it supposed to make a difference if it's in a github repo or not? Usually my projects are, this one isn't public.

@JoeRobich
Copy link
Member

Closing as duplicate of OmniSharp/omnisharp-roslyn#2125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants