1

Opened a blazor project for the first time in a while and suddenly no code or components are recognized (even on newly created projects): ss1

When I hover over components no auto-completion suggestions, no details, code in @code {} is not recognized. .cs files work fine.

What I've tried:

  • deleting .vs, obj, bin folders
  • clean solution and rebuilding
  • open/closing visual studio
  • pull latest version of the project which worked on somebody else's pc
  • repairing visual studio 2022 (I have the same configurations as the working vs2022)
  • reset vs (Intellisense) settings
  • restarting pc
  • disabling all vs extensions
  • update settings and vs2022 to latest version
  • double checked if I have Razor Language Services

It worked one time after I took a half hour break (I think I did a reinstall of ASP.NET and web development before the break), so I closed vs and reopened the solution and it stopped working again. But that's programming I guess..

Anybody else ever had this issue? I couldn't seem to find anything of use online

10
  • What .NET version does it target? Commented Oct 1 at 7:55
  • It targets net8.0 Commented Oct 1 at 8:11
  • Does it work if you create a new .NET 9 Blazor project? You can ensure that you have the latest project templates by running dotnet new update from the command line. Then create the Blazor porject from the command line using dotnet new blazor -f net9.0 -n BlazorTest9 and see if that works. If it does, try dotnet new blazor -f net8.0 -n BlazorTest8 to see if it works with .NET 8. (Run the commands from an empty directory of course.) Commented Oct 1 at 8:21
  • 1
    Seems like something is horribly broken. I can't think of anything other than a complete uninstall and reinstall of Visual Studio, sorry! (I assume you're on Visual Studio version 17.14.16) Commented Oct 1 at 8:50
  • 1
    When you run the VS Installer and click Modify, make sure the "Web apps" workload is selected. I don't see that mentioned in the Q. Commented Oct 1 at 8:52

1 Answer 1

2

It's unfortunately a Visual Studio bug.

Fixed it by replacing the resolution-patch.js in C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\CommonExtensions\Microsoft\TypeScript\eslint-server

Source: https://developercommunity.visualstudio.com/t/TaskFailed-ActivatinglanguageclientRazorLanguageServerClient:RazorLanguageServerClientfailedtoinitialize./10907203

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.