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

Omnisharp failed to load with InternalLoggerExeception error #2171

Closed
dhp279 opened this issue Jun 3, 2021 · 1 comment · Fixed by #2172
Closed

Omnisharp failed to load with InternalLoggerExeception error #2171

dhp279 opened this issue Jun 3, 2021 · 1 comment · Fixed by #2172

Comments

@dhp279
Copy link

dhp279 commented Jun 3, 2021

Issue Description

Omnisharp crashes when opening some project.

Steps to Reproduce

Expected Behavior

Omnisharp starts successfully

Actual Behavior

Omnisharp unable to load project

Logs

OmniSharp log

Starting OmniSharp server at 6/3/2021, 3:49:52 PM Target: c:\DsMainDev\testsrc\ntdbms\SEIPipeline\PipelineInfrastructure.sln

OmniSharp server started.
Path: c:\Users\dapha.REDMOND.000.vscode\extensions\ms-dotnettools.csharp-1.23.12.omnisharp\1.37.11-beta.23\OmniSharp.exe
PID: 7648

Starting OmniSharp on Windows 6.2.9200.0 (x64)
info: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 4 MSBuild instance(s)
1: Visual Studio Build Tools 2017 15.9.28307.1500 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
2: Visual Studio Enterprise 2017 15.9.28307.1500 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin"
3: Visual Studio Enterprise 2019 16.10.31321.278 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin"
4: StandAlone 16.11.0 - "c:\Users\dapha.REDMOND.000.vscode\extensions\ms-dotnettools.csharp-1.23.12.omnisharp\1.37.11-beta.23.msbuild\Current\Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Visual Studio Enterprise 2019 16.10.31321.278 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\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:\somepath\SEIPipeline'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
Skip loading projects listed in solution file or under target directory because MsBuild:LoadProjectsOnDemand is true.
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\somepath\SEIPipeline'.
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:\somepath\SEIPipeline' on host 47720.
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'SomeProj.csproj'
info: OmniSharp.MSBuild.ProjectManager
Loading project: SomeProj.csproj
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'SomeProj.csproj'.
SomeProj.cs(0,0)
Microsoft.Build.Exceptions.InternalLoggerException: The build stopped unexpectedly because of an unexpected logger failure. ---> Microsoft.Build.Exceptions.InternalLoggerException: The build stopped unexpectedly because of an unexpected logger failure. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at OmniSharp.MSBuild.Logging.MSBuildDiagnostic.CreateFrom(BuildErrorEventArgs args) in D:\a\1\s\src\OmniSharp.MSBuild\Logging\MSBuildDiagnostic.cs:line 39
at OmniSharp.MSBuild.Logging.MSBuildLogger.OnError(Object sender, BuildErrorEventArgs args) in D:\a\1\s\src\OmniSharp.MSBuild\Logging\MSBuildLogger.cs:line 29
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseErrorEvent(Object sender, BuildErrorEventArgs buildEvent)
--- End of inner exception stack trace ---
at Microsoft.Build.Exceptions.InternalLoggerException.Throw(Exception innerException, BuildEventArgs e, String messageResourceName, Boolean initializationException, String[] messageArgs)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseErrorEvent(Object sender, BuildErrorEventArgs buildEvent)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseAnyEvent(Object sender, BuildEventArgs buildEvent)
--- End of inner exception stack trace ---
at Microsoft.Build.Exceptions.InternalLoggerException.Throw(Exception innerException, BuildEventArgs e, String messageResourceName, Boolean initializationException, String[] messageArgs)
at Microsoft.Build.BackEnd.Logging.EventSourceSink.RaiseAnyEvent(Object sender, BuildEventArgs buildEvent)
at Microsoft.Build.BackEnd.Logging.LoggingService.RouteBuildEvent(BuildEventArgs eventArg)
at Microsoft.Build.BackEnd.Logging.LoggingService.RouteBuildEvent(Object loggingEvent)
at Microsoft.Build.BackEnd.Logging.LoggingService.LoggingEventProcessor(Object loggingEvent)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Microsoft.Build.Execution.BuildManager.EndBuild()
at Microsoft.Build.Execution.BuildManager.Build(BuildParameters parameters, BuildRequestData requestData)
at Microsoft.Build.Execution.ProjectInstance.Build(String[] targets, IEnumerable1 loggers, IEnumerable1 remoteLoggers, ILoggingService loggingService, Int32 maxNodeCount, IDictionary2& targetOutputs) at OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath, IReadOnlyDictionary2 configurationsInSolution) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs:line 99
at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectIdInfo projectIdInfo, ProjectLoader loader, Guid sessionId, DotNetInfo dotNetInfo) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectFile\ProjectFileInfo.cs:line 117
at OmniSharp.MSBuild.ProjectManager.<>c__DisplayClass31_0.b__0() in D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs:line 304
at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func`1 loader) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs:line 315

Attempted to update project that is not loaded: c:\somepath\SEIPipeline.csproj
Received response for /v2/codestructure but could not find request.

C# log

Getting latest OmniSharp version information Downloading package 'Latest OmniSharp Version Information' (1 KB).................... Done! Getting latest OmniSharp version information Downloading package 'Latest OmniSharp Version Information' (1 KB).................... Done! Getting latest OmniSharp version information Downloading package 'Latest OmniSharp Version Information' (1 KB).................... Done! Getting latest OmniSharp version information Downloading package 'Latest OmniSharp Version Information' (1 KB).................... Done!

Environment information

VSCode version: 1.56.2
C# Extension: 1.23.12

Dotnet Information .NET SDK (reflecting any global.json): Version: 5.0.300 Commit: 2e0c8c940e

Runtime Environment:
OS Name: Windows
OS Version: 10.0.19043
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.300\

Host (useful for support):
Version: 5.0.6
Commit: 478b2f8c0e

.NET SDKs installed:
3.1.409 [C:\Program Files\dotnet\sdk]
5.0.203 [C:\Program Files\dotnet\sdk]
5.0.300 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.28 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
better-comments aaron-bond 2.1.0
better-cpp-syntax jeff-hykin 1.15.5
Bookmarks alefragnani 13.0.4
code-runner formulahendry 0.11.4
code-spell-checker streetsidesoftware 1.10.2
cpptools ms-vscode 1.4.0
csharp ms-dotnettools 1.23.12
gitlens eamodio 11.4.1
gruvbox-material sainnhe 6.4.5
gruvbox-themes tomphilbin 1.0.0
material-icon-theme PKief 4.7.0
mssql ms-mssql 1.10.1
powershell ms-vscode 2021.5.1
tabnine-vscode TabNine 3.4.4
vim vscodevim 1.20.3
vscode-icons vscode-icons-team 11.4.0
vscode-peacock johnpapa 3.9.1
wtm dapha 0.0.2
xml DotJoshJohnson 2.5.1
@JoeRobich
Copy link
Member

Nullable annotations would sure help here, but it looks like args.Code is potentially null.

if (args.Code.Equals("MSB3644", StringComparison.OrdinalIgnoreCase))

@JoeRobich JoeRobich transferred this issue from dotnet/vscode-csharp Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@JoeRobich @dhp279 and others