razor: New Razor Editor - Error activating HtmlyLanguageClient
Hi,
I switched on the new Razor editor in VS 16.9 Preview 3 and I get an error message at the top of the editor: "There was an error activating the remote language server, HtmlyLanguageClient. It’s a .Net 5.0 Blazor project.
I switched on the logging, and it may or may not be related, but I noticed this error:
Log: OmniSharp.Extensions.LanguageServer.Shared.LspRequestRouter: Finished: Routing Request (5) razor/monitorProjectConfigurationFilePath in 15ms | Id=‘5’ Method=‘razor/monitorProjectConfigurationFilePath’ ElapsedMilliseconds=‘15’
Error: OmniSharp.Extensions.JsonRpc.InputHandler: Failed to handle request razor/monitorProjectConfigurationFilePath 5 - System.IO.DirectoryNotFoundException: Could not find a part of the path ‘C:\WINDOWS\system32\obj\Debug\net5.0’.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileSystemEnumerableIterator1.CommonInit() at System.IO.FileSystemEnumerableIterator
1…ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost) at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption) at Microsoft.AspNetCore.Razor.LanguageServer.ProjectConfigurationFileChangeDetector.GetExistingConfigurationFiles(String workspaceDirectory) at Microsoft.AspNetCore.Razor.LanguageServer.ProjectConfigurationFileChangeDetector.<StartAsync>d__5.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Razor.LanguageServer.MonitorProjectConfigurationFilePathEndpoint.<Handle>d__8.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at OmniSharp.Extensions.LanguageServer.Server.Pipelines.SemanticTokensDeltaPipeline
2.<Handle>d__0.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Extensions.LanguageServer.Server.Pipelines.ResolveCommandPipeline2.<Handle>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MediatR.Pipeline.RequestPreProcessorBehavior
2.<Handle>d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at MediatR.Pipeline.RequestPostProcessorBehavior2.<Handle>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MediatR.Pipeline.RequestExceptionProcessorBehavior
2.<Handle>d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at MediatR.Pipeline.RequestExceptionProcessorBehavior2.<Handle>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at MediatR.Pipeline.RequestExceptionActionProcessorBehavior
2.<Handle>d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at MediatR.Pipeline.RequestExceptionActionProcessorBehavior2.<Handle>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at OmniSharp.Extensions.JsonRpc.RequestRouterBase
1.<<RouteRequest>g__InnerRoute|5_0>d.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at OmniSharp.Extensions.JsonRpc.RequestRouterBase`1.<RouteRequest>d__5.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at OmniSharp.Extensions.JsonRpc.InputHandler.<>c__DisplayClass38_0.<<RouteRequest>b__5>d.MoveNext() | Method=‘razor/monitorProjectConfigurationFilePath’ RequestId=‘5’
Log: OmniSharp.Extensions.JsonRpc.InputHandler: Finished: Processing request razor/monitorProjectConfigurationFilePath 5 in 40ms | Method=‘razor/monitorProjectConfigurationFilePath’ ResponseId=‘5’ ElapsedMilliseconds=‘40’
Thanks, no rush, I’ve just turned it off again! 😃
LJ
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (9 by maintainers)
Hello, I searched again in the logs of vs 2019 while open an ASP.NET Core MVC project and it displays the same log about the HTML Language Server activation.
HtmlLanguageClient: Sending initialize request: StreamJsonRpc.RemoteInvocationException: Internal Error - System.MissingMethodException: Method not found: 'System.Collections.Generic.IDictionary
2<System.String,Newtonsoft.Json.Linq.JToken> OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities.ServerCapabilities.get_Experimental()'. en Microsoft.WebTools.Languages.LanguageServer.Server.Shared.Capabilities.ExtendableServerCapabilities..ctor(ServerCapabilities inner, IEnumerable
1 registrationExtensions) en Microsoft.WebTools.Languages.LanguageServer.Server.Html.HtmlLanguageServer.<>c.<CreateAsync>b__4_2(ILanguageServer server, InitializeParams request, InitializeResult response, CancellationToken cancellationToken) en OmniSharp.Extensions.LanguageServer.Server.LanguageServer.<>c__DisplayClass76_0.<MediatR.IRequestHandler<OmniSharp.Extensions.LanguageServer.Protocol.Models.InternalInitializeParams,OmniSharp.Extensions.LanguageServer.Protocol.Models.InitializeResult>.Handle>b__4(OnLanguageServerInitializedDelegate handler, CancellationToken ct) en OmniSharp.Extensions.LanguageServer.Protocol.LanguageProtocolEventingHelper.<>c__DisplayClass0_12.<Run>b__2(CancellationToken ct) en System.Reactive.Linq.QueryLanguage.StartAsyncImpl(Func
2 actionAsync, IScheduler scheduler) en /_/Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Async.cs:línea 806.I Have found other composition errors, there are 19 in total about other parts of the Html language client, here is some examples : 1. Microsoft.WebTools.Languages.Html.Editor.Formatting.ContainedLanguage.FormatterProviders.TypeScriptContainedLanguageFormatterProvider.ctor (threadSwitcher) - Exactly 1 export expected to match restrictions: Contract name: Microsoft.WebTools.Shared.IThreadSwitcher TypeIdentityName: Microsoft.WebTools.Shared.IThreadSwitcher but 0 was found. 2. Microsoft.WebTools.Languages.Html.Editor.Razor.RazorHtmlScriptOrStyleTagNamesServiceProviderProxy.RazorVersionDetector: Exactly 1 export expected to match restrictions: Contract name: Microsoft.WebTools.Languages.Html.Editor.ContainedLanguage.Razor.Def.IRazorVersionDetector TypeIdentityName: Microsoft.WebTools.Languages.Html.Editor.ContainedLanguage.Razor.Def.IRazorVersionDetector but 0 was found.
The error included is expected when the project is in the midst of being initialized and wont fail any part of the project creation. That being said the fact taht the HTMLY language client fails to boot is concerning:
@ToddGrun is there something else @LaughingJohn can provide for you to investigate?