Open crmmvio opened 1 year ago
Hey @crmmvio, this might be a duplicate of #5561 as you might have "format on save" on. Maybe have a look at this issue, as your problem might be tracked there as well.
A PR with a fix has been proposed recently, but a release with the extension seems to be a longer process, so we might need to wait a little longer for a fix.
When try saved file .cshtml, the vscode saved the file, but generate message erro "Request textDocument/formatting failed.", my currently version C# OmmiSharp is 1.25.7
I going to come back version 1.25.2 because this work corretly.
Log: Starting OmniSharp server at 5/4/2023, 10:32:23 AM Target: c:\Users\moviocr1\Projetos\1859-SGK\SgkUI\SgkUI.sln
OmniSharp server started with .NET 7.0.203 . Path: c:\Users\moviocr1.vscode\extensions\ms-dotnettools.csharp-1.25.7-win32-x64.omnisharp\1.39.6-net6.0\OmniSharp.dll PID: 28320
System.ArgumentException: "" não é parte do workspace.
at Microsoft.CodeAnalysis.Workspace.CheckProjectIsInSolution(Solution solution, ProjectId projectId)
at Microsoft.CodeAnalysis.Workspace.CheckProjectIsInCurrentSolution(ProjectId projectId)
at Microsoft.CodeAnalysis.Workspace.<>c__DisplayClass58_0.b0(Solution oldSolution)
at Microsoft.CodeAnalysis.Workspace.<>c.b 26_3(Solution oldSolution, ValueTuple
7 data) at Microsoft.CodeAnalysis.Workspace.SetCurrentSolution[TData](Func
3 transformation, TData data, Action3 onBeforeUpdate, Action
3 onAfterUpdate) at Microsoft.CodeAnalysis.Workspace.SetCurrentSolution(Func2 transformation, Func
3 changeKind, ProjectId projectId, DocumentId documentId, Action2 onBeforeUpdate, Action
2 onAfterUpdate) at Microsoft.CodeAnalysis.Workspace.SetCurrentSolution(Func2 transformation, WorkspaceChangeKind changeKind, ProjectId projectId, DocumentId documentId, Action
2 onBeforeUpdate, Action2 onAfterUpdate) at Microsoft.CodeAnalysis.Workspace.OnProjectReferenceAdded(ProjectId projectId, ProjectReference projectReference) at OmniSharp.OmniSharpWorkspace.AddProjectReference(ProjectId projectId, ProjectReference projectReference) in D:\a\1\s\src\OmniSharp.Roslyn\OmniSharpWorkspace.cs:line 122 at OmniSharp.MSBuild.ProjectManager.UpdateProjectReferences(Project project, ImmutableArray
1 projectReferencePaths) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs:line 816 at OmniSharp.MSBuild.ProjectManager.UpdateProject(String projectFilePath, String changeTriggerFilePath) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs:line 482 at OmniSharp.MSBuild.ProjectManager.ProcessQueue(CancellationToken cancellationToken) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs:line 268 at OmniSharp.MSBuild.ProjectManager.ProcessLoopAsync(CancellationToken cancellationToken) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs:line 185{ "Type": "request", "Seq": 23, "Command": "/close", "Arguments": { "FileName": "c:\Users\moviocr1\Projetos\1859-SGK\SgkUI\src\CBL.Sgk.UI\Views\Shared\_NavMenu.cshtml__virtual.cs" } }
{ "Request_seq": 23, "Command": "/close", "Running": true, "Success": false, "Message": "\"System.ArgumentException: \\"_NavMenu.cshtmlvirtual.cs\\" não está aberto.\r\n at Microsoft.CodeAnalysis.Workspace.CheckDocumentIsOpen(DocumentId documentId)\r\n at Microsoft.CodeAnalysis.Workspace.<>c.b 199_0(Solution oldSolution, ValueTuple
4 data)\\r\\n at Microsoft.CodeAnalysis.Workspace.SetCurrentSolution[TData](Func
3 transformation, TData data, Action3 onBeforeUpdate, Action
3 onAfterUpdate)\r\n at Microsoft.CodeAnalysis.Workspace.OnDocumentClosed(DocumentId documentId, TextLoader reloader, Boolean updateActiveContext)\r\n at OmniSharp.OmniSharpWorkspace.CloseDocument(DocumentId documentId) in D:\\a\\1\\s\\src\\OmniSharp.Roslyn\\OmniSharpWorkspace.cs:line 106\r\n at OmniSharp.Roslyn.CSharp.Services.Files.FileCloseService.Handle(FileCloseRequest request) in D:\\a\\1\\s\\src\\OmniSharp.Roslyn.CSharp\\Services\\Files\\FileCloseService.cs:line 25\r\n at OmniSharp.Endpoint.Exports.RequestHandlerExportHandler2.Handle(TRequest request) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\Exports\\\\RequestHandlerExportHandler.cs:line 29\\r\\n at OmniSharp.Endpoint.EndpointHandler
2.AggregateResponsesFromLanguageHandlers(ExportHandler2[] handlers, TRequest request) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 165\\r\\n at OmniSharp.Endpoint.EndpointHandler
2.HandleRequestForLanguage(String language, TRequest request, RequestPacket packet) in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 226\r\n at OmniSharp.Endpoint.EndpointHandler`2.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\"", "Body": null, "Seq": 1634, "Type": "response" }