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
When editing a Razor document, get constant popups "Request textDocument/onTypeFormatting failed." When I click the "Go to output" button, I see the following errors logged:
Razor.VSCode version 7.0.0-preview.23067.5
Razor's trace level is currently set to 'Off'
To change Razor's trace level set 'razor.trace' to 'Off', 'Messages' or 'Verbose' and then restart VSCode.
To report issues invoke the 'Report a Razor issue' command via the command palette.
With Csharp extension 1.25.4 installed, create a new MVC Web Application. Then just edit the Index.cshtml file by typing or pasting some code in. Any keypress results in the popup.
Expected Behavior
No errors when typing
Actual Behavior
Error when typing
Logs
OmniSharp log
Starting OmniSharp server at 2023-02-02, 10:25:28 a.m.
Target: /home/-/Programming/VSCode Projects/SignalR/SignalRSample
OmniSharp server started with .NET 6.0.113
.
Path: /home/-/.vscode/extensions/ms-dotnettools.csharp-1.25.4-linux-x64/.omnisharp/1.39.4-net6.0/OmniSharp.dll
PID: 10113
Starting OmniSharp on Unknown 0.0 (Unknown) info: OmniSharp.Services.DotNetCliService
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK info: OmniSharp.Services.DotNetCliService
DotNetPath set to /usr/lib/dotnet/dotnet info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: .NET Core SDK 6.0.113 17.0.1 - "/usr/lib/dotnet/sdk/6.0.113/" info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: .NET Core SDK 6.0.113 17.0.1 - "/usr/lib/dotnet/sdk/6.0.113/" info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0 info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/-/Programming/VSCode Projects/SignalR/SignalRSample'. info: OmniSharp.Cake.CakeProjectSystem
Did not find any Cake files info: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/home/-/Programming/VSCode Projects/SignalR/SignalRSample' info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/-/Programming/VSCode Projects/SignalR/SignalRSample/SignalRSample.csproj' info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/-/Programming/VSCode Projects/SignalR/SignalRSample'. info: OmniSharp.Script.ScriptProjectSystem
Did not find any CSX files info: OmniSharp.WorkspaceInitializer
Configuration finished. info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/-/Programming/VSCode Projects/SignalR/SignalRSample' on host 9924. info: OmniSharp.MSBuild.ProjectManager
Loading project: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/SignalRSample.csproj info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/-/Programming/VSCode Projects/SignalR/SignalRSample/SignalRSample.csproj'. info: OmniSharp.MSBuild.ProjectManager
Adding project '/home/-/Programming/VSCode Projects/SignalR/SignalRSample/SignalRSample.csproj' info: OmniSharp.MSBuild.ProjectManager
Update project: SignalRSample
Received response for /v2/getcodeactions but could not find request.
Received response for /completion/resolve but could not find request.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
Received response for /v2/getcodeactions but could not find request.
Received response for /completion/resolve but could not find request.
Received response for /completion/resolve but could not find request.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 7, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 7, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 8, Column: 0.
Received response for /completion/resolve but could not find request.
Received response for /v2/getcodeactions but could not find request.
Received response for /v2/getcodeactions but could not find request.
Received response for /v2/getcodeactions but could not find request.
Received response for /completion/resolve but could not find request.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 15, Column: 39.
[warn]: OmniSharp.Stdio.Host
************ Request ************
{
"Type": "request",
"Seq": 1891,
"Command": "/close",
"Arguments": {
"FileName": "/home/-/Programming/VSCode Projects/SignalR/SignalRSample/Views/Home/Index.cshtml__virtual.cs"
}
}
[fail]: OmniSharp.Stdio.Host
************ Response (9.2403ms) ************
{
"Request_seq": 1891,
"Command": "/close",
"Running": true,
"Success": false,
"Message": ""System.ArgumentException: 'Index.cshtml__bg__virtual.cs' is not open.\n at Microsoft.CodeAnalysis.Workspace.CheckDocumentIsOpen(DocumentId documentId)\n at Microsoft.CodeAnalysis.Workspace.<>c.b__199_0(Solution oldSolution, ValueTuple4 data)\\n at Microsoft.CodeAnalysis.Workspace.SetCurrentSolution[TData](Func3 transformation, TData data, Action3 onBeforeUpdate, Action3 onAfterUpdate)\n at Microsoft.CodeAnalysis.Workspace.OnDocumentClosed(DocumentId documentId, TextLoader reloader, Boolean updateActiveContext)\n at OmniSharp.OmniSharpWorkspace.CloseDocument(DocumentId documentId) in /home/vsts/work/1/s/src/OmniSharp.Roslyn/OmniSharpWorkspace.cs:line 106\n at OmniSharp.Roslyn.CSharp.Services.Files.FileCloseService.Handle(FileCloseRequest request) in /home/vsts/work/1/s/src/OmniSharp.Roslyn.CSharp/Services/Files/FileCloseService.cs:line 25\n at OmniSharp.Endpoint.EndpointHandler2.AggregateResponsesFromLanguageHandlers(ExportHandler2[] handlers, TRequest request) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 190\n at OmniSharp.Endpoint.EndpointHandler2.HandleRequestForLanguage(String language, TRequest request, RequestPacket packet) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 233\\n at OmniSharp.Endpoint.EndpointHandler2.Process(RequestPacket packet, LanguageModel model, JToken requestObject) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 142\n at OmniSharp.Stdio.Host.HandleRequest(String json, ILogger logger) in /home/vsts/work/1/s/src/OmniSharp.Stdio/Host.cs:line 258"",
"Body": null,
"Seq": 28491,
"Type": "response"
}
[warn]: OmniSharp.Stdio.Host
************ Request ************
{
"Type": "request",
"Seq": 1905,
"Command": "/close",
"Arguments": {
"FileName": "/home/-/Programming/VSCode Projects/SignalR/SignalRSample/Views/Home/Index.cshtml__virtual.cs"
}
}
[fail]: OmniSharp.Stdio.Host
************ Response (0.8935ms) ************
{
"Request_seq": 1905,
"Command": "/close",
"Running": true,
"Success": false,
"Message": ""System.ArgumentException: 'Index.cshtml__virtual.cs' is not open.\n at Microsoft.CodeAnalysis.Workspace.CheckDocumentIsOpen(DocumentId documentId)\n at Microsoft.CodeAnalysis.Workspace.<>c.b__199_0(Solution oldSolution, ValueTuple4 data)\\n at Microsoft.CodeAnalysis.Workspace.SetCurrentSolution[TData](Func3 transformation, TData data, Action3 onBeforeUpdate, Action3 onAfterUpdate)\n at Microsoft.CodeAnalysis.Workspace.OnDocumentClosed(DocumentId documentId, TextLoader reloader, Boolean updateActiveContext)\n at OmniSharp.OmniSharpWorkspace.CloseDocument(DocumentId documentId) in /home/vsts/work/1/s/src/OmniSharp.Roslyn/OmniSharpWorkspace.cs:line 106\n at OmniSharp.Roslyn.CSharp.Services.Files.FileCloseService.Handle(FileCloseRequest request) in /home/vsts/work/1/s/src/OmniSharp.Roslyn.CSharp/Services/Files/FileCloseService.cs:line 25\n at OmniSharp.Endpoint.EndpointHandler2.AggregateResponsesFromLanguageHandlers(ExportHandler2[] handlers, TRequest request) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 190\n at OmniSharp.Endpoint.EndpointHandler2.HandleRequestForLanguage(String language, TRequest request, RequestPacket packet) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 233\\n at OmniSharp.Endpoint.EndpointHandler2.Process(RequestPacket packet, LanguageModel model, JToken requestObject) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 142\n at OmniSharp.Stdio.Host.HandleRequest(String json, ILogger logger) in /home/vsts/work/1/s/src/OmniSharp.Stdio/Host.cs:line 258"",
"Body": null,
"Seq": 30696,
"Type": "response"
}
C# log
(empty)
Environment information
VSCode version: 1.74.3 C# Extension: 1.25.4
Mono Information
There is a problem with running OmniSharp on mono: Error: Unable to find Mono. Ensure that Mono's '/bin' folder is added to your environment's PATH variable.Dotnet Information
.NET SDK (reflecting any global.json):
Version: 6.0.113
Commit: 4a23b50f97
Runtime Environment:
OS Name: linuxmint
OS Version: 21.1
OS Platform: Linux
RID: ubuntu.22.04-x64
Base Path: /usr/lib/dotnet/sdk/6.0.113/
I mentioned in my original post that it could be related to #5561. Definitely not a duplicate, as steps to reproduce, symptoms, and actual error message are different.
Issue Description
When editing a Razor document, get constant popups "Request textDocument/onTypeFormatting failed." When I click the "Go to output" button, I see the following errors logged:
Steps to Reproduce
With Csharp extension 1.25.4 installed, create a new MVC Web Application. Then just edit the Index.cshtml file by typing or pasting some code in. Any keypress results in the popup.
Expected Behavior
No errors when typing
Actual Behavior
Error when typing
Logs
OmniSharp log
Starting OmniSharp server at 2023-02-02, 10:25:28 a.m.
Target: /home/-/Programming/VSCode Projects/SignalR/SignalRSample
OmniSharp server started with .NET 6.0.113
.
Path: /home/-/.vscode/extensions/ms-dotnettools.csharp-1.25.4-linux-x64/.omnisharp/1.39.4-net6.0/OmniSharp.dll
PID: 10113
Starting OmniSharp on Unknown 0.0 (Unknown)
info: OmniSharp.Services.DotNetCliService
Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
info: OmniSharp.Services.DotNetCliService
DotNetPath set to /usr/lib/dotnet/dotnet
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: .NET Core SDK 6.0.113 17.0.1 - "/usr/lib/dotnet/sdk/6.0.113/"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: .NET Core SDK 6.0.113 17.0.1 - "/usr/lib/dotnet/sdk/6.0.113/"
info: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/-/Programming/VSCode Projects/SignalR/SignalRSample'.
info: OmniSharp.Cake.CakeProjectSystem
Did not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in '/home/-/Programming/VSCode Projects/SignalR/SignalRSample'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/-/Programming/VSCode Projects/SignalR/SignalRSample/SignalRSample.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/-/Programming/VSCode Projects/SignalR/SignalRSample'.
info: OmniSharp.Script.ScriptProjectSystem
Did not find any CSX files
info: OmniSharp.WorkspaceInitializer
Configuration finished.
info: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/-/Programming/VSCode Projects/SignalR/SignalRSample' on host 9924.
info: OmniSharp.MSBuild.ProjectManager
Loading project: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/SignalRSample.csproj
info: OmniSharp.MSBuild.ProjectManager
Successfully loaded project file '/home/-/Programming/VSCode Projects/SignalR/SignalRSample/SignalRSample.csproj'.
info: OmniSharp.MSBuild.ProjectManager
Adding project '/home/-/Programming/VSCode Projects/SignalR/SignalRSample/SignalRSample.csproj'
info: OmniSharp.MSBuild.ProjectManager
Update project: SignalRSample
Received response for /v2/getcodeactions but could not find request.
Received response for /completion/resolve but could not find request.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 6, Column: 0.
Received response for /v2/getcodeactions but could not find request.
Received response for /completion/resolve but could not find request.
Received response for /completion/resolve but could not find request.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 7, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 7, Column: 0.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 8, Column: 0.
Received response for /completion/resolve but could not find request.
Received response for /v2/getcodeactions but could not find request.
Received response for /v2/getcodeactions but could not find request.
Received response for /v2/getcodeactions but could not find request.
Received response for /completion/resolve but could not find request.
[warn]: OmniSharp.Roslyn.CSharp.Services.Navigation.FindUsagesService
No symbol found. File: /home/-/Programming/VSCode Projects/SignalR/SignalRSample/StaticDetails.cs, Line: 15, Column: 39.
[warn]: OmniSharp.Stdio.Host
************ Request ************
{
"Type": "request",
"Seq": 1891,
"Command": "/close",
"Arguments": {
"FileName": "/home/-/Programming/VSCode Projects/SignalR/SignalRSample/Views/Home/Index.cshtml__virtual.cs"
}
}
[fail]: OmniSharp.Stdio.Host
************ Response (9.2403ms) ************
{
"Request_seq": 1891,
"Command": "/close",
"Running": true,
"Success": false,
"Message": ""System.ArgumentException: 'Index.cshtml__bg__virtual.cs' is not open.\n at Microsoft.CodeAnalysis.Workspace.CheckDocumentIsOpen(DocumentId documentId)\n at Microsoft.CodeAnalysis.Workspace.<>c.b__199_0(Solution oldSolution, ValueTuple
4 data)\\n at Microsoft.CodeAnalysis.Workspace.SetCurrentSolution[TData](Func
3 transformation, TData data, Action3 onBeforeUpdate, Action
3 onAfterUpdate)\n at Microsoft.CodeAnalysis.Workspace.OnDocumentClosed(DocumentId documentId, TextLoader reloader, Boolean updateActiveContext)\n at OmniSharp.OmniSharpWorkspace.CloseDocument(DocumentId documentId) in /home/vsts/work/1/s/src/OmniSharp.Roslyn/OmniSharpWorkspace.cs:line 106\n at OmniSharp.Roslyn.CSharp.Services.Files.FileCloseService.Handle(FileCloseRequest request) in /home/vsts/work/1/s/src/OmniSharp.Roslyn.CSharp/Services/Files/FileCloseService.cs:line 25\n at OmniSharp.Endpoint.EndpointHandler2.AggregateResponsesFromLanguageHandlers(ExportHandler
2[] handlers, TRequest request) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 190\n at OmniSharp.Endpoint.EndpointHandler2.HandleRequestForLanguage(String language, TRequest request, RequestPacket packet) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 233\\n at OmniSharp.Endpoint.EndpointHandler
2.Process(RequestPacket packet, LanguageModel model, JToken requestObject) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 142\n at OmniSharp.Stdio.Host.HandleRequest(String json, ILogger logger) in /home/vsts/work/1/s/src/OmniSharp.Stdio/Host.cs:line 258"","Body": null,
"Seq": 28491,
"Type": "response"
}
[warn]: OmniSharp.Stdio.Host
************ Request ************
{
"Type": "request",
"Seq": 1905,
"Command": "/close",
"Arguments": {
"FileName": "/home/-/Programming/VSCode Projects/SignalR/SignalRSample/Views/Home/Index.cshtml__virtual.cs"
}
}
[fail]: OmniSharp.Stdio.Host
************ Response (0.8935ms) ************
{
"Request_seq": 1905,
"Command": "/close",
"Running": true,
"Success": false,
"Message": ""System.ArgumentException: 'Index.cshtml__virtual.cs' is not open.\n at Microsoft.CodeAnalysis.Workspace.CheckDocumentIsOpen(DocumentId documentId)\n at Microsoft.CodeAnalysis.Workspace.<>c.b__199_0(Solution oldSolution, ValueTuple
4 data)\\n at Microsoft.CodeAnalysis.Workspace.SetCurrentSolution[TData](Func
3 transformation, TData data, Action3 onBeforeUpdate, Action
3 onAfterUpdate)\n at Microsoft.CodeAnalysis.Workspace.OnDocumentClosed(DocumentId documentId, TextLoader reloader, Boolean updateActiveContext)\n at OmniSharp.OmniSharpWorkspace.CloseDocument(DocumentId documentId) in /home/vsts/work/1/s/src/OmniSharp.Roslyn/OmniSharpWorkspace.cs:line 106\n at OmniSharp.Roslyn.CSharp.Services.Files.FileCloseService.Handle(FileCloseRequest request) in /home/vsts/work/1/s/src/OmniSharp.Roslyn.CSharp/Services/Files/FileCloseService.cs:line 25\n at OmniSharp.Endpoint.EndpointHandler2.AggregateResponsesFromLanguageHandlers(ExportHandler
2[] handlers, TRequest request) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 190\n at OmniSharp.Endpoint.EndpointHandler2.HandleRequestForLanguage(String language, TRequest request, RequestPacket packet) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 233\\n at OmniSharp.Endpoint.EndpointHandler
2.Process(RequestPacket packet, LanguageModel model, JToken requestObject) in /home/vsts/work/1/s/src/OmniSharp.Host/Endpoint/EndpointHandler.cs:line 142\n at OmniSharp.Stdio.Host.HandleRequest(String json, ILogger logger) in /home/vsts/work/1/s/src/OmniSharp.Stdio/Host.cs:line 258"","Body": null,
"Seq": 30696,
"Type": "response"
}
C# log
Environment information
VSCode version: 1.74.3
C# Extension: 1.25.4
Mono Information
There is a problem with running OmniSharp on mono: Error: Unable to find Mono. Ensure that Mono's '/bin' folder is added to your environment's PATH variable.Dotnet Information
.NET SDK (reflecting any global.json): Version: 6.0.113 Commit: 4a23b50f97Runtime Environment:
OS Name: linuxmint
OS Version: 21.1
OS Platform: Linux
RID: ubuntu.22.04-x64
Base Path: /usr/lib/dotnet/sdk/6.0.113/
global.json file:
Not found
Host:
Version: 6.0.13
Architecture: x64
Commit: 1af80ba017
.NET SDKs installed:
6.0.113 [/usr/lib/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.13 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.13 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]
Download .NET:
https://aka.ms/dotnet-download
Learn about .NET Runtimes and SDKs:
https://aka.ms/dotnet/runtimes-sdk-info
Visual Studio Code Extensions
Additional Information
May be related to #5561
The text was updated successfully, but these errors were encountered: