dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.86k stars 672 forks source link

Blazor WASM - Invalid Intellisense Warnings/Errors #4635

Open tannertaylor opened 3 years ago

tannertaylor commented 3 years ago

Issue Description

Invalid Intellisense warnings/errors in a brand new Blazor WASM project. In particular, it doesn't recognize the App type in Program.cs and it doesn't recognize the components in App.razor. In practice, however, the application compiles and runs perfectly.

Steps to Reproduce

Expected Behavior

I'd expect a brand new project to show no errors.

Actual Behavior

Intellisense shows invalid warnings and errors and the OmniSharp log shows the same error.

image

image

Logs

OmniSharp log

Starting OmniSharp server at 6/30/2021, 7:57:05 PM Target: c:\Users\Tanner\code\blazor-sample OmniSharp server started. Path: c:\Users\Tanner\.vscode\extensions\ms-dotnettools.csharp-1.23.12\.omnisharp\1.37.10\OmniSharp.exe PID: 8408 [info]: OmniSharp.Stdio.Host Starting OmniSharp on Windows 6.2.9200.0 (x64) [info]: OmniSharp.Services.DotNetCliService DotNetPath set to dotnet [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Located 2 MSBuild instance(s) 1: Visual Studio Professional 2019 16.9.31205.134 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin" 2: StandAlone 16.11.0 - "c:\Users\Tanner\.vscode\extensions\ms-dotnettools.csharp-1.23.12\.omnisharp\1.37.10\.msbuild\Current\Bin" [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: Visual Studio Professional 2019 16.9.31205.134 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin" [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0 [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0 [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100 [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110 [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140 [info]: OmniSharp.Cake.CakeProjectSystem Detecting Cake files in 'c:\Users\Tanner\code\blazor-sample'. [info]: OmniSharp.Cake.CakeProjectSystem Could not find any Cake files [info]: OmniSharp.MSBuild.ProjectSystem No solution files found in 'c:\Users\Tanner\code\blazor-sample' [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'c:\Users\Tanner\code\blazor-sample\blazor-sample.csproj' [info]: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in 'c:\Users\Tanner\code\blazor-sample'. [info]: OmniSharp.Script.ScriptProjectSystem Could not find any CSX files [info]: OmniSharp.WorkspaceInitializer Configuration finished. [info]: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location 'c:\Users\Tanner\code\blazor-sample' on host 21248. [info]: OmniSharp.MSBuild.ProjectManager Loading project: c:\Users\Tanner\code\blazor-sample\blazor-sample.csproj [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file 'c:\Users\Tanner\code\blazor-sample\blazor-sample.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Adding project 'c:\Users\Tanner\code\blazor-sample\blazor-sample.csproj' [info]: OmniSharp.MSBuild.ProjectManager Update project: blazor-sample [info]: OmniSharp.Roslyn.CSharp.Services.Diagnostics.CSharpDiagnosticWorkerWithAnalyzers Solution initialized -> queue all documents for code analysis. Initial document count: 3. Received response for /v2/getcodeactions but could not find request. Received response for /quickinfo but could not find request.

C# log

None

Environment information

VSCode version: 1.57.1 C# Extension: 1.23.12

Dotnet Information .NET SDK (reflecting any global.json): Version: 5.0.202 Commit: db7cc87d51 Runtime Environment: OS Name: Windows OS Version: 10.0.19043 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.202\ Host (useful for support): Version: 5.0.5 Commit: 2f740adc14 .NET SDKs installed: 5.0.202 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.All 2.1.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.27 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.27 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |blazorwasm-companion|ms-dotnettools|1.1.0| |csharp|ms-dotnettools|1.23.12| |csharpextensions|jchannon|1.3.1| |powershell|ms-vscode|2021.6.2| |prettify-json|mohsen1|0.0.3| |remote-containers|ms-vscode-remote|0.183.0| |remote-wsl|ms-vscode-remote|0.56.5| |TabOut|albert|0.2.0| |vscode-docker|ms-azuretools|1.14.0| |vscode-dotnet-runtime|ms-dotnettools|1.1.0| |vscode-icons|vscode-icons-team|11.5.0| |vscodeintellicode|VisualStudioExptTeam|1.2.14|;
tomschrot commented 3 years ago

YES I have the same issues. Since today intellisense in Blazor files is completely broken and does no longer work!

SandhuJaspreet commented 3 years ago

I had the same issue. Doesn't go away no matter what you do. Then I downgraded one version to 1.23.11. I recommend you do this as well. I don't have those intellisense warnings anymore.

tomschrot commented 3 years ago

I did this already, thank you. The problems with omnisharp / razor are getting worse... I hope they fix it with the next release

Am Mi., 7. Juli 2021 um 06:05 Uhr schrieb Jaspreet Sandhu < @.***>:

I had the same issue. Doesn't go away no matter what you do. Then I downgraded one version to 1.23.11. I recommend you do this as well. I don't have those intellisense warnings anymore.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/OmniSharp/omnisharp-vscode/issues/4635#issuecomment-875257887, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJEDNVILCSCZNASVVHDXH3TWPHBZANCNFSM47TPU5WA .