dotnet / razor

Compiler and tooling experience for Razor ASP.NET Core apps in Visual Studio, Visual Studio for Mac, and VS Code.
https://asp.net
MIT License
505 stars 196 forks source link

Routes is unknown tag #10920

Open ilajosmanov opened 2 months ago

ilajosmanov commented 2 months ago

Type: Bug

Issue Description

Blazor application with predefined files, Routes tag is not visible for the extention.

Steps to Reproduce

  1. Create new BlazorApp.
  2. Go to App.razor
  3. See the error: Found markup element with unexpected name 'Routes'. If this is intended to be a component, add a @using directive for its namespace.Razor(RZ10012)

Expected Behavior

I shouldn't see this error, because is predefined component in Blazor ecosystem.

Actual Behavior

I see warning.

Logs

C# log

Post the output from Output-->C# here

C# LSP Trace Logs

Post the output from Output-->C# LSP Trace Logs here. Requires `dotnet.server.trace` to be set to `Trace`

Environment information

VSCode version: 1.93.1 C# Extension: 2.45.25 Using OmniSharp: false

Dotnet Information .NET SDK: Version: 8.0.108 Commit: 665a05cea7 Workload version: 8.0.100-manifests.109ff937 Runtime Environment: OS Name: ubuntu OS Version: 24.04 OS Platform: Linux RID: ubuntu.24.04-x64 Base Path: /usr/lib/dotnet/sdk/8.0.108/ .NET workloads installed: Workload version: 8.0.100-manifests.109ff937 There are no installed workloads to display. Host: Version: 8.0.8 Architecture: x64 Commit: 08338fcaa5 .NET SDKs installed: 8.0.108 [/usr/lib/dotnet/sdk] .NET runtimes installed: Microsoft.AspNetCore.App 8.0.8 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 8.0.8 [/usr/lib/dotnet/shared/Microsoft.NETCore.App] Other architectures found: None Environment variables: Not set global.json file: Not found Learn more: https://aka.ms/dotnet/info Download .NET: https://aka.ms/dotnet/download
Visual Studio Code Extensions |Extension|Author|Version|Folder Name| |---|---|---|---| |code-spell-checker|streetsidesoftware|3.0.1|streetsidesoftware.code-spell-checker-3.0.1| |codesnap|adpyke|1.3.4|adpyke.codesnap-1.3.4| |copilot|GitHub|1.229.0|github.copilot-1.229.0| |copilot-chat|GitHub|0.20.1|github.copilot-chat-0.20.1| |csdevkit|ms-dotnettools|1.10.18|ms-dotnettools.csdevkit-1.10.18-linux-x64| |csharp|ms-dotnettools|2.45.25|ms-dotnettools.csharp-2.45.25-linux-x64| |dotenv|mikestead|1.0.1|mikestead.dotenv-1.0.1| |EditorConfig|EditorConfig|0.16.4|editorconfig.editorconfig-0.16.4| |markdown-preview-enhanced|shd101wyy|0.8.14|shd101wyy.markdown-preview-enhanced-0.8.14| |svg-preview|SimonSiefke|2.8.3|simonsiefke.svg-preview-2.8.3| |vscode-dotnet-runtime|ms-dotnettools|2.1.5|ms-dotnettools.vscode-dotnet-runtime-2.1.5| |vscode-tailwindcss|bradlc|0.12.10|bradlc.vscode-tailwindcss-0.12.10|;

Extension version: 2.45.25 VS Code version: Code 1.93.1 (38c31bc77e0dd6ae88a4e9cc93428cc27a56ba40, 2024-09-11T17:20:05.685Z) OS version: Linux x64 6.8.0-45-generic snap Modes:

System Info |Item|Value| |---|---| |CPUs|AMD Ryzen 7 7840U w/ Radeon 780M Graphics (16 x 1474)| |GPU Status|2d_canvas: unavailable_software
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: disabled_software
multiple_raster_threads: enabled_on
opengl: disabled_off
rasterization: disabled_software
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: disabled_software
video_encode: disabled_software
vulkan: disabled_off
webgl: unavailable_software
webgl2: unavailable_software
webgpu: disabled_off
webnn: disabled_off| |Load (avg)|0, 1, 1| |Memory (System)|60.63GB (50.43GB free)| |Process Argv|--no-sandbox --force-user-env --crash-reporter-id d0fd8722-3a41-4894-8d3e-82b3efd1dc9b| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|ubuntu| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu| |XDG_SESSION_TYPE|wayland|
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805cf:30301675 binariesv615:30325510 vsaa593:30376534 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 a9j8j154:30646983 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonnoceb:30805159 asynctok:30898717 pythonmypyd1:30879173 2e7ec940:31000449 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 dsvsc021:30996838 01bff139:31013167 a69g1124:31058053 dvdeprecation:31068756 dwnewjupytercf:31046870 impr_priority:31102340 nativerepl2:31139839 refactort:31108082 pythonrstrctxt:31112756 flightc:31134773 wkspc-onlycs-t:31132770 nativeloc1:31134641 wkspc-ranged-c:31125598 fje88620:31121564 ```
ryzngard commented 2 months ago

@ilajosmanov thanks for your filing. Does the problem go away after time or is it permanent? I wasn't able to reproduce on my linux setup (fedora with a few different dotnet sdks installed). If you're still hitting I'll get an ubuntu machine and try to duplicate your setup.

Also, could you post the razor/c# logs here? Setting these two settings will get the most information:

"razor.server.trace": "Trace",
"dotnet.server.trace": "Trace",