You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.NET 8 Preview 4 updates Roslyn from 4.6.0 to 4.7.0, which makes OmniSharp unable to load correct analyzer assemblies when user is using .NET 8 Preview 4.
Example OmniSharp error log
************ Response (2.9415ms) ************
{
"Request_seq": 81,
"Command": "/v2/getcodeactions",
"Running": true,
"Success": false,
"Message": ""System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.\r\nCould not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nCould not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nCould not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nCould not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nCould not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nCould not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nCould not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nCould not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nCould not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nCould not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\n at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)\r\n at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.CachingCodeFixProviderForProjects.<>c.b__6_0(AnalyzerFileReference analyzerFileReference) in D:\\a\\1\\s\\src\\OmniSharp.Roslyn.CSharp\\Services\\Refactoring\\V2\\CachingCodeFixProviderForProjects.cs:line 64\r\n at System.Linq.Enumerable.SelectManySingleSelectorIterator2.MoveNext()\\r\\n at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()\r\n at System.Linq.Enumerable.WhereEnumerableIterator1.MoveNext()\\r\\n at System.Collections.Generic.LargeArrayBuilder1.AddRange(IEnumerable1 items)\\r\\n at System.Collections.Generic.SparseArrayBuilder1.ReserveOrAdd(IEnumerable1 items)\\r\\n at System.Linq.Enumerable.Concat2Iterator1.ToArray()\r\n at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable1 items)\\r\\n at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.CachingCodeFixProviderForProjects.LoadFrom(Project project) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn.CSharp\\\\Services\\\\Refactoring\\\\V2\\\\CachingCodeFixProviderForProjects.cs:line 95\\r\\n at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.CachingCodeFixProviderForProjects.GetAllCodeFixesForProject(ProjectId projectId) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn.CSharp\\\\Services\\\\Refactoring\\\\V2\\\\CachingCodeFixProviderForProjects.cs:line 57\\r\\n at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.BaseCodeActionService2.GetSortedCodeFixProviders(Document document) in D:\\a\\1\\s\\src\\OmniSharp.Roslyn.CSharp\\Services\\Refactoring\\V2\\BaseCodeActionService.cs:line 170\r\n at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.BaseCodeActionService2.AppendFixesAsync(Document document, TextSpan span, IEnumerable1 diagnostics, List1 codeActions) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn.CSharp\\\\Services\\\\Refactoring\\\\V2\\\\BaseCodeActionService.cs:line 142\\r\\n at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.BaseCodeActionService2.CollectCodeFixesActions(Document document, TextSpan span, List1 codeActions) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn.CSharp\\\\Services\\\\Refactoring\\\\V2\\\\BaseCodeActionService.cs:line 134\\r\\n at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.BaseCodeActionService2.GetAvailableCodeActions(ICodeActionRequest request) in D:\\a\\1\\s\\src\\OmniSharp.Roslyn.CSharp\\Services\\Refactoring\\V2\\BaseCodeActionService.cs:line 86\r\n at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.GetCodeActionsService.Handle(GetCodeActionsRequest request) in D:\\a\\1\\s\\src\\OmniSharp.Roslyn.CSharp\\Services\\Refactoring\\V2\\GetCodeActionsService.cs:line 34\r\n at OmniSharp.Endpoint.EndpointHandler2.GetFirstNotEmptyResponseFromHandlers(ExportHandler2[] handlers, TRequest request) in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 200\r\n at OmniSharp.Endpoint.EndpointHandler2.HandleRequestForLanguage(String language, TRequest request, RequestPacket packet) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 229\\r\\n at OmniSharp.Endpoint.EndpointHandler2.Process(RequestPacket packet, LanguageModel model, JToken requestObject) in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 130\r\n at OmniSharp.Stdio.Host.HandleRequest(String json, ILogger logger) in D:\\a\\1\\s\\src\\OmniSharp.Stdio\\Host.cs:line 218\r\nSystem.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nFile name: 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'\r\nSystem.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nFile name: 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'\r\nSystem.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nFile name: 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'\r\nSystem.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nFile name: 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'\r\nSystem.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nFile name: 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'\r\nSystem.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nFile name: 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'\r\nSystem.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nFile name: 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'\r\nSystem.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nFile name: 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'\r\nSystem.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nFile name: 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'\r\nSystem.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\nFile name: 'Microsoft.CodeAnalysis.Workspaces, Version=4.7.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'"",
"Body": null,
"Seq": 183,
"Type": "response"
}
The text was updated successfully, but these errors were encountered:
.NET 8 Preview 4 updates Roslyn from 4.6.0 to 4.7.0, which makes OmniSharp unable to load correct analyzer assemblies when user is using .NET 8 Preview 4.
Example OmniSharp error log
The text was updated successfully, but these errors were encountered: