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

Update to Roslyn 4.7.0 #2534

Closed
cfbao opened this issue May 26, 2023 · 0 comments
Closed

Update to Roslyn 4.7.0 #2534

cfbao opened this issue May 26, 2023 · 0 comments

Comments

@cfbao
Copy link

cfbao commented May 26, 2023

.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"
}

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.

1 participant