dotnet / vscode-csharp

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

VS Code: After installing C# extension and creating blazor project will meet warning: "Found markup element with unexpected name 'PageTitle'". #5630

Closed v-wenkecheng closed 1 year ago

v-wenkecheng commented 1 year ago

VS Code: 1.76.1 C# Extension version:1.25.5 SDK: 8.0.0-Preview.3.23164.2

Platform 

To reproduce: 

  1. Open a normal Terminal Emulator, create MVC project and open it using VS code
    md Blazor
    cd Blazor
    dotnet new blazorserver
    code .
  2. Go to https://github.com/OmniSharp/omnisharp-vscode/releases > Download the csharp-1.25.5-win32-x64.vsix.
  3. In VS Code and go to the Extensions Tab, select "Install from VSIX" > install the file you downloaded.
  4. Navigate to Explorer (at the upper left corner) > Open Pages/index.razor, verify there is no any error in PROBLEMS window.

Actual behavior: "Found markup element with unexpected name 'PageTitle'. If this is intended to be a component, add a @using directive for its namespace.".

image

Expected behavior: image

Additional context: Note: 

  1. This issue does not repro on C# extension 1.25.4.
  2. This issue only repro on C# extension 1.25.5.
XorZy commented 1 year ago

I am also seeing this on Arch with .NET 7.0.102.

TrieBr commented 1 year ago

This seemed to have fixed after upgrading to extension 1.25.8 for me. At least for now..

JoeRobich commented 1 year ago

This issue seems to be resolved when using .NET 8 Preview 4. Please reopen issue if it pop back up.

Neogamezzz commented 3 months ago

Same problem

lperry65 commented 2 months ago

I'm using VS Code on Mac, I've made sure C# extensions are up to date. I've deleted bin and obj folders and done a clean and a build. Nothing works, still get the warnings.

Found markup element with unexpected name 'PageTitle'. If this is intended to be a component, add a @using directive for its namespace.Razor(RZ10012)

Screenshot 2024-07-23 at 10 23 13

This is a new Blazor app created with dotnet new.

Screenshot 2024-07-23 at 10 29 37

`dotnet --info .NET SDK: Version: 8.0.303 Commit: 29ab8e3268 Workload version: 8.0.300-manifests.c915c39d MSBuild version: 17.10.4+10fbfbf2e

Runtime Environment: OS Name: Mac OS X OS Version: 14.5 OS Platform: Darwin RID: osx-x64 Base Path: /usr/local/share/dotnet/sdk/8.0.303/

.NET workloads installed: There are no installed workloads to display.

Host: Version: 8.0.7 Architecture: x64 Commit: 2aade6beb0

.NET SDKs installed: 5.0.103 [/usr/local/share/dotnet/sdk] 6.0.302 [/usr/local/share/dotnet/sdk] 8.0.301 [/usr/local/share/dotnet/sdk] 8.0.302 [/usr/local/share/dotnet/sdk] 8.0.303 [/usr/local/share/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 5.0.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 8.0.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 5.0.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 8.0.7 [/usr/local/share/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 lee@MacBook-Pro:~/dev/code/dotnet/BlazorApp`

Neogamezzz commented 2 months ago

Try to downgrade the C# extension to version 2.22.5

magz123 commented 1 month ago

This BUG still exist in C# extension v2.45.25 image