razor
razor copied to clipboard
VSCode raise warning "Found markup element with unexpected name"
Is this a Bug or Feature request?:
Bug
Steps to reproduce
- open new terminal and execute
dotnet new blazorserver -n Blazor1
- Launch VSCode on new created folder
- Edit the Pages/Index.razor
Description of the problem:
The <PageTitle>
element and <SurveyPrompt>
element are not recognized
Expected behavior:
The <PageTitle>
element and <SurveyPrompt>
element are correctly recognized
Actual behavior:
The IntelliSense raise warning
Logs
OmniSharp
Starting OmniSharp server at 25/12/2021, 17:56:54 Target: d:\Developz\Temp\Blazor1
OmniSharp server started. Path: C:/Users/massimo/scoop/apps/omnisharp/current/omnisharp.exe PID: 14200
Starting OmniSharp on Windows 6.2.9200.0 (x64) info: OmniSharp.Services.DotNetCliService Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK info: OmniSharp.Services.DotNetCliService Using the 'dotnet' on the PATH. info: OmniSharp.Services.DotNetCliService DotNetPath set to dotnet info: OmniSharp.MSBuild.Discovery.MSBuildLocator Located 2 MSBuild instance(s) 1: Visual Studio Enterprise 2019 16.11.31702.278 16.11.0 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin" 2: StandAlone 17.0.0 - "C:\Users\massimo\scoop\apps\omnisharp\current.msbuild\Current\Bin" info: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: Visual Studio Enterprise 2019 16.11.31702.278 16.11.0 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\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 'd:\Developz\Temp\Blazor1'. info: OmniSharp.Cake.CakeProjectSystem Did not find any Cake files info: OmniSharp.MSBuild.ProjectSystem No solution files found in 'd:\Developz\Temp\Blazor1' info: OmniSharp.MSBuild.ProjectManager Queue project update for 'd:\Developz\Temp\Blazor1\Blazor1.csproj' info: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in 'd:\Developz\Temp\Blazor1'. info: OmniSharp.Script.ScriptProjectSystem Did not find any CSX files info: OmniSharp.WorkspaceInitializer Configuration finished. info: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location 'd:\Developz\Temp\Blazor1' on host 6600. info: OmniSharp.MSBuild.ProjectManager Loading project: d:\Developz\Temp\Blazor1\Blazor1.csproj [warn]: OmniSharp.MSBuild.ProjectLoader Targeting .NET 6.0 in Visual Studio 2019 is not supported. info: OmniSharp.MSBuild.ProjectManager Successfully loaded project file 'd:\Developz\Temp\Blazor1\Blazor1.csproj'. d:\Developz\Temp\Blazor1\Blazor1.csproj C:\Program Files\dotnet\sdk\6.0.101\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(134,5): Error: Targeting .NET 6.0 in Visual Studio 2019 is not supported.
Adding project 'd:\Developz\Temp\Blazor1\Blazor1.csproj'
[fail]: OmniSharp.MSBuild.ProjectManager
Failed to add project to workspace: 'd:\Developz\Temp\Blazor1\Blazor1.csproj'
[fail]: OmniSharp.MSBuild.ProjectManager
Could not locate project in workspace: d:\Developz\Temp\Blazor1\Blazor1.csproj
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages\Counter.razor__virtual.cs added to workspace
info: OmniSharp.Roslyn.CSharp.Services.Diagnostics.CSharpDiagnosticWorkerWithAnalyzers
Solution initialized -> queue all documents for code analysis. Initial document count: 1.
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages\Error.cshtml__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages\FetchData.razor__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Shared\MainLayout.razor__virtual.cs added to workspace
[warn]: OmniSharp.Stdio.Host
************ Request ************
{
"Type": "request",
"Seq": 69,
"Command": "/filesChanged",
"Arguments": [
{
"FileName": "d:\Developz\Temp\Blazor1\obj\Debug\net6.0\Blazor1.GeneratedMSBuildEditorConfig.editorconfig",
"changeType": "Change"
}
]
}
[fail]: OmniSharp.Stdio.Host
************ Response (28.5175ms) ************
{
"Request_seq": 69,
"Command": "/filesChanged",
"Running": true,
"Success": false,
"Message": ""System.NullReferenceException: Object reference not set to an instance of an object.\r\n at OmniSharp.MSBuild.ProjectManager.UpdateAnalyzerConfigFile(Project project, String analyzerConfigFile) in D:\\a\\1\\s\\src\\OmniSharp.MSBuild\\ProjectManager.cs:line 606\r\n at OmniSharp.MSBuild.ProjectManager.UpdateAnalyzerConfigFile(ProjectFileInfo projectFileInfo, String analyzerConfigFile, FileChangeType changeType) in D:\\a\\1\\s\\src\\OmniSharp.MSBuild\\ProjectManager.cs:line 572\r\n at OmniSharp.FileWatching.ManualFileSystemWatcher.Callbacks.Invoke(String filePath, FileChangeType changeType) in D:\\a\\1\\s\\src\\OmniSharp.Host\\FileWatching\\ManualFileSystemWatcher.Callbacks.cs:line 22\r\n at OmniSharp.FileWatching.ManualFileSystemWatcher.Notify(String filePath, FileChangeType changeType) in D:\\a\\1\\s\\src\\OmniSharp.Host\\FileWatching\\ManualFileSystemWatcher.cs:line 43\r\n at OmniSharp.Roslyn.CSharp.Services.Files.OnFilesChangedService.Handle(IEnumerable1 requests) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn.CSharp\\\\Services\\\\Files\\\\OnFilesChangedService.cs:line 27\\r\\n at OmniSharp.Endpoint.EndpointHandler
2.<AggregateResponsesFromLanguageHandlers>d__18.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 164\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at OmniSharp.Endpoint.EndpointHandler2.<HandleRequestForLanguage>d__20.MoveNext() in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 227\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at OmniSharp.Endpoint.EndpointHandler
2.<Process>d__16.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 138\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at OmniSharp.Stdio.Host.<HandleRequest>d__14.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Stdio\\Host.cs:line 218"",
"Body": null,
"Seq": 116,
"Type": "response"
}
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages_Host.cshtml__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages_Layout.cshtml__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages\Counter.razor__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages\Error.cshtml__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages\FetchData.razor__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages\Index.razor__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Shared\NavMenu.razor__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Shared\SurveyPrompt.razor__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1_Imports.razor__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\App.razor__virtual.cs added to workspace
[warn]: OmniSharp.Stdio.Host
************ Request ************
{
"Type": "request",
"Seq": 173,
"Command": "/filesChanged",
"Arguments": [
{
"FileName": "d:\Developz\Temp\Blazor1\obj\Debug\net6.0\Blazor1.GeneratedMSBuildEditorConfig.editorconfig",
"changeType": "Change"
}
]
}
[fail]: OmniSharp.Stdio.Host
************ Response (0.8337ms) ************
{
"Request_seq": 173,
"Command": "/filesChanged",
"Running": true,
"Success": false,
"Message": ""System.NullReferenceException: Object reference not set to an instance of an object.\r\n at OmniSharp.MSBuild.ProjectManager.UpdateAnalyzerConfigFile(Project project, String analyzerConfigFile) in D:\\a\\1\\s\\src\\OmniSharp.MSBuild\\ProjectManager.cs:line 606\r\n at OmniSharp.MSBuild.ProjectManager.UpdateAnalyzerConfigFile(ProjectFileInfo projectFileInfo, String analyzerConfigFile, FileChangeType changeType) in D:\\a\\1\\s\\src\\OmniSharp.MSBuild\\ProjectManager.cs:line 572\r\n at OmniSharp.FileWatching.ManualFileSystemWatcher.Callbacks.Invoke(String filePath, FileChangeType changeType) in D:\\a\\1\\s\\src\\OmniSharp.Host\\FileWatching\\ManualFileSystemWatcher.Callbacks.cs:line 22\r\n at OmniSharp.FileWatching.ManualFileSystemWatcher.Notify(String filePath, FileChangeType changeType) in D:\\a\\1\\s\\src\\OmniSharp.Host\\FileWatching\\ManualFileSystemWatcher.cs:line 43\r\n at OmniSharp.Roslyn.CSharp.Services.Files.OnFilesChangedService.Handle(IEnumerable1 requests) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn.CSharp\\\\Services\\\\Files\\\\OnFilesChangedService.cs:line 27\\r\\n at OmniSharp.Endpoint.EndpointHandler
2.<AggregateResponsesFromLanguageHandlers>d__18.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 164\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at OmniSharp.Endpoint.EndpointHandler2.<HandleRequestForLanguage>d__20.MoveNext() in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 227\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at OmniSharp.Endpoint.EndpointHandler
2.<Process>d__16.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 138\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at OmniSharp.Stdio.Host.<HandleRequest>d__14.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Stdio\\Host.cs:line 218"",
"Body": null,
"Seq": 248,
"Type": "response"
}
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages\PageTitle.razor__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages\Index.razor__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages\PageTitle.razor__virtual.cs added to workspace
[warn]: OmniSharp.Stdio.Host
************ Request ************
{
"Type": "request",
"Seq": 207,
"Command": "/filesChanged",
"Arguments": [
{
"FileName": "d:\Developz\Temp\Blazor1\obj\Debug\net6.0\Blazor1.GeneratedMSBuildEditorConfig.editorconfig",
"changeType": "Change"
}
]
}
[fail]: OmniSharp.Stdio.Host
************ Response (0.7167ms) ************
{
"Request_seq": 207,
"Command": "/filesChanged",
"Running": true,
"Success": false,
"Message": ""System.NullReferenceException: Object reference not set to an instance of an object.\r\n at OmniSharp.MSBuild.ProjectManager.UpdateAnalyzerConfigFile(Project project, String analyzerConfigFile) in D:\\a\\1\\s\\src\\OmniSharp.MSBuild\\ProjectManager.cs:line 606\r\n at OmniSharp.MSBuild.ProjectManager.UpdateAnalyzerConfigFile(ProjectFileInfo projectFileInfo, String analyzerConfigFile, FileChangeType changeType) in D:\\a\\1\\s\\src\\OmniSharp.MSBuild\\ProjectManager.cs:line 572\r\n at OmniSharp.FileWatching.ManualFileSystemWatcher.Callbacks.Invoke(String filePath, FileChangeType changeType) in D:\\a\\1\\s\\src\\OmniSharp.Host\\FileWatching\\ManualFileSystemWatcher.Callbacks.cs:line 22\r\n at OmniSharp.FileWatching.ManualFileSystemWatcher.Notify(String filePath, FileChangeType changeType) in D:\\a\\1\\s\\src\\OmniSharp.Host\\FileWatching\\ManualFileSystemWatcher.cs:line 43\r\n at OmniSharp.Roslyn.CSharp.Services.Files.OnFilesChangedService.Handle(IEnumerable1 requests) in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Roslyn.CSharp\\\\Services\\\\Files\\\\OnFilesChangedService.cs:line 27\\r\\n at OmniSharp.Endpoint.EndpointHandler
2.<AggregateResponsesFromLanguageHandlers>d__18.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 164\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at OmniSharp.Endpoint.EndpointHandler2.<HandleRequestForLanguage>d__20.MoveNext() in D:\\\\a\\\\1\\\\s\\\\src\\\\OmniSharp.Host\\\\Endpoint\\\\EndpointHandler.cs:line 227\\r\\n--- End of stack trace from previous location where exception was thrown ---\\r\\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\\r\\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\\r\\n at OmniSharp.Endpoint.EndpointHandler
2.<Process>d__16.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Host\\Endpoint\\EndpointHandler.cs:line 138\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at OmniSharp.Stdio.Host.<HandleRequest>d__14.MoveNext() in D:\\a\\1\\s\\src\\OmniSharp.Stdio\\Host.cs:line 218"",
"Body": null,
"Seq": 303,
"Type": "response"
}
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages\FetchData.razor__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages\Index.razor__virtual.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: d:\Developz\Temp\Blazor1\Pages\Index.razor__virtual.cs added to workspace
Razor
Expand
[Client - 18:10:43] -- Starting Issue Data Collection--
[Client - 18:10:45] -- Stopping Issue Data Collection--
Workspace information
Razor document:
Expand
Non Razor file as active document
Projected CSharp document:
Expand
Could not determine CSharp content
Projected Html document:
Expand
Could not determine Html content
Machine information
VSCode version: 1.63.2 Razor.VSCode version: 1.23.17
dotnet --info
Expand
.NET SDK (reflecting any global.json):
Version: 6.0.101
Commit: ef49f6213a
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22000
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.101\
Host (useful for support):
Version: 6.0.1
Commit: 3a25a7f1cc
.NET SDKs installed:
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.818 [C:\Program Files\dotnet\sdk]
2.2.402 [C:\Program Files\dotnet\sdk]
3.1.403 [C:\Program Files\dotnet\sdk]
3.1.416 [C:\Program Files\dotnet\sdk]
5.0.104 [C:\Program Files\dotnet\sdk]
5.0.210 [C:\Program Files\dotnet\sdk]
5.0.303 [C:\Program Files\dotnet\sdk]
5.0.401 [C:\Program Files\dotnet\sdk]
5.0.404 [C:\Program Files\dotnet\sdk]
6.0.101 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.17 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.21 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.30 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.19 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.22 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Extensions
Expand
Extension | Author | Version |
---|---|---|
auto-using | Fudge | 0.7.15 |
azure-account | ms-vscode | 0.9.11 |
azurecli | ms-vscode | 0.5.0 |
code-settings-sync | Shan | 3.4.3 |
color-highlight | naumovs | 2.5.0 |
csharp | ms-dotnettools | 1.23.17 |
debugger-for-edge | msjsdiag | 1.0.15 |
docthis | joelday | 0.7.1 |
dotnet-core-add | solidcube | 0.1.2 |
dotnet-test-explorer | formulahendry | 0.7.7 |
eslint-disable-snippets | drKnoxy | 1.3.0 |
fluent-icons | miguelsolorio | 0.0.15 |
git-graph | mhutchie | 1.30.0 |
github-vscode-theme | GitHub | 5.1.0 |
gitlens | eamodio | 11.7.0 |
markdown-all-in-one | yzhang | 3.4.0 |
material-icon-theme | PKief | 4.11.0 |
msbuild-project-tools | tintoy | 0.4.3 |
mssql | ms-mssql | 1.12.0 |
npm-intellisense | christian-kohler | 1.4.0 |
nugetpackagemanagergui | aliasadidev | 1.1.9 |
numbered-bookmarks | alefragnani | 8.1.0 |
output-colorizer | IBM | 0.1.2 |
powershell | ms-vscode | 2021.12.0 |
prettier-vscode | esbenp | 9.0.0 |
project-manager | alefragnani | 12.4.0 |
rainbow-csv | mechatroner | 2.0.0 |
remote-containers | ms-vscode-remote | 0.209.6 |
remote-ssh | ms-vscode-remote | 0.70.0 |
remote-ssh-edit | ms-vscode-remote | 0.70.0 |
remote-ssh-explorer | ms-vscode-remote | 0.56.0 |
remote-wsl | ms-vscode-remote | 0.63.13 |
test-adapter-converter | ms-vscode | 0.1.5 |
theme-dracula | dracula-theme | 2.24.1 |
todo-tree | Gruntfuggly | 0.0.214 |
trxviewer | scabana | 1.0.1 |
user-secrets | adrianwilczynski | 2.0.1 |
vetur | octref | 0.35.0 |
vsc-community-material-theme | Equinusocio | 1.4.2 |
vsc-material-theme | Equinusocio | 33.1.2 |
vscode-docker | ms-azuretools | 1.18.0 |
vscode-drawio | hediet | 1.6.3 |
vscode-eslint | dbaeumer | 2.2.2 |
vscode-import-cost | wix | 2.15.0 |
vscode-markdownlint | DavidAnson | 0.45.0 |
vscode-nuget-gallery | patcx | 0.0.24 |
vscode-nupkg | eridem | 1.0.1 |
vscode-remote-extensionpack | ms-vscode-remote | 0.21.0 |
vscode-taskexplorer | spmeesseman | 2.5.7 |
vscode-theme-onedark | akamud | 2.2.3 |
vscode-thunder-client | rangav | 1.9.1 |
vscode-versionlens | pflannery | 1.0.9 |
vscode-wakatime | WakaTime | 18.0.2 |
vscode-yaml | redhat | 1.2.2 |
vscodeintellicode | VisualStudioExptTeam | 1.2.15 |
vtpw | snovakovic | 0.1.2 |
Vue2 | ducksoupdev | 0.1.3 |
xml | DotJoshJohnson | 2.5.1 |
I have found this related dotnet razor tool issue where user says's to delete the obj
and the bin
folders and rebuild.
Does clearing bin and obj fix the issue? Also it looks like O# is throwing a null-ref. Perhaps that's causing design time completion to be incorrect?
Hi @m4ss1m0g. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Does clearing bin and obj fix the issue?
Yes
Also it looks like O# is throwing a null-ref. Perhaps that's causing design time completion to be incorrect?
I don't know
Looks like this may be related to https://github.com/dotnet/razor-tooling/issues/4590.
Update
The issue also occurs after some time of coding, to mitigate the issue I delete obj
and bin
folders and the issue the command dotnet build
and restart OmniSharp.
I'm using vscode, and deleting obj
and bin
and restarting vscode or omnisharp doesn't resolve the issue for me. I used the blazorserver template.
If you are using vs. Exclude the new file from the project and include it again: this mostly happens with newly created files
I had exact same issue is Visual Studio/Visual studio code.
Solution for already broken file a. Visual studio: Right click on broken .razor file -> Properties -> Build Action -> "Content". b. Visual studio code: .csproj file -> Manually remove lines:
<ItemGroup>
<Content Remove="PathToComponent\Component.razor" />
</ItemGroup>
<ItemGroup>
<None Include="PathToComponent\Component.razor" />
</ItemGroup>
If after that change project wont compile, made sure .razor.cs file is partial class.
How to prevent this from happening
Visual studio (Communnity 2022 [17.2.5]) keep adding these (b.) to csproj every time I create .razor
file. To prevent this I added
<ItemGroup>
<Content Include="..\**\*.razor" />
</ItemGroup>
to .csrpoj file.
Environment: linux, vscode, net6, blazor.
In my Razor Class Library that contains blazor components, I get:
Found markup element with unexpected name
and
The attribute names could not be inferred from bind attribute 'bind-Foo'" ...
I used a variation of the workaround above (by @NightAngell) in my .csproj
:
<ItemGroup>
<Content Remove="**/*.razor" />
<None Include="**/*.razor" />
</ItemGroup>
rm -rf bin obj
dotnet build
...And the problem disappeared! Huh?!
Can someone explain why that works?
UPDATE: doesn't work when there are also Foo.razor.css
files ("error BLAZOR102: The scoped css file Foo.razor.css' was defined but no associated razor component or view was found for it.")
UPDATE2: sometimes it works, sometimes it doesn't. The blazor tooling is really really really broken! :rage:
I'm trying to create my first MAUI Blazor app and hitting these issues on macOS.
Workarounds above didn't help. Tried deleting obj and bin with rebuilds and nothing helped.

I was able to get around this by adding @namespace Mobile.Shared
to every file in the shared directory. Something buggy is going on.
Using this version of the preview build and my Razor pages are totally buggered, some work, some do, some sometimes work. Deleting the bin and obj folders makes VS recognize a component and it's parameters but if you go into that component it's like looking at your code with Notepad.exe, zero syntax highlighting.
Any news on a fix, better work arounds? We can't even continue our work now. Probably have to system restore or try a different visual studio version 😡
I was able to get around this by adding
@namespace Mobile.Shared
to every file in the shared directory. Something buggy is going on.
Thanks, this seemed to work for me.
I was getting "Found markup element with unexpected name" for a component even right beside my main component, but it couldn't find it for some reason. Adding the @namespace declaration in that file and my shared files seemed to work.
So, i had the same issue, but thanks god after 3h searching i found out that at least in my particular case, the problem was at Nugets packages in the folder .nuget. I delete everything in it, and after that i created a new project and restore ou dependencies. it worked.
Don't forget to install the brand new "C#" extension in the VSCode, i think is part of C# Dev Kit, because we don't know the really cousa of that issue until now... Hope that help anyone!!
In my case it was the C# extension(ms-dotnettools.csharp). I started seeing the issue after updated from v1.26.0 to v2.0.376. I resolved it by reverting back to v1.26.0
Approaching a 2-year birthday without a solution or workaround.
The workaround is to use Rider until this extension is usable someday.
This issue is the only thing missing for me to be able to use vscode
Just got the same issue. Worked great a couple of days ago and now I get these warnings. Removed obj and bin folders. reinstalled C# dev kit, removed all items from my nuget folder. Nothing helped.
Side by side view: vscode and visualstudio
@puppetSpace performed same steps as you of course it didn't work. What strangely fixed it was creating the code behind files, as in XComponent.razor.cs: public partial class XComponent {}
At least I can repeat it. If I delete the code behind file and reload vs code, the error reappears. If I then create the file, the error goes away.
@namespace
I am facing the same issue in 3 April 2024
Same here
Adding to my previous comment. have your code behind file inherit from the corresponding class. For a normal component for example:
public partial class XComponent : ComponentBase {}
This seems to immediately solve it for me. But you have to do it for every component. You basically need to help out the LS into recognizing the components, whether explicitly stating it in the (razor.cs) or the (razor) file itself.
This issue wasn't assigned to anyone and looks to have been missed. For those still hitting the issue, I have some follow up questions:
- How frequent is it happening?
- Are you using the newest C# extension, and are you also using C# Dev Kit?
- Are you using the omnisharp option?
- What operating system are you hitting this one?
- Can you share logs and/or a solution that you're having this issue with?
In the mean time, I'll assign myself and mark as needs more info until I get a bit more context. We've been busy working on a lot of improvements in the project system area that often results in mass errors like these. Knowing if they have been fixed or are still problematic and at what scope helps us prioritize correctly.
@ryzngard I'm not sure if the root cause is the same, but I filed a similar bug with repro steps. In my case it seemed to just stop indexing files after a certain number of files exist in the project even if csharp.maxProjectFileCountForDiagnosticAnalysis
was set to unlimited or a high number.
https://github.com/dotnet/vscode-csharp/issues/6921
@TrieBr I know we've had issues with linux around the number of file watchers, that may be the culprit for that particular case. It's good to know they might be related. OS is a big factor for some of these
Interesting. Does that apply to Mac too? I normally use VSCode on Mac, but I opened my exact project on a Windows VM and my particular issue seem to be fixed or at least less obviously broken.
In this screenshot, the left side is in a Windows VM and the right is Mac. On Mac, notice the yellow squiggly lines. In the case of my PaymentPeriodTransactions
, the file exists in the same folder as the file I'm editing so it's even more strange that it's not recognized as a component (on Mac).
EDIT: I managed to break the Windows one by switching to pre-release C# extension (switching back to stable also remains broken now).
I managed to break the Windows one by switching to pre-release C# extension (switching back to stable also remains broken now).
Does deleting the obj folder(s) fix this issue? The project information as of now is stored on disk so it may be that the broken state is stale data that needs to be cleaned up. We're working on fixing this in upcoming releases with a larger architecture change but in the meantime doing targeted fixes where we can unblock people
Cleaning obj/bin folders on Windows fixed the problem. Doing the same on Mac made the problem worse (none of the components are recognized now). The razor log (on MAC) shows tons of errors like the following:
File '/Path/ToFile/Component.razor' didn't exist in the Razor document list. This is likely because it's from outside the workspace.
razor.provideDynamicFileInfo failed with CodeExpectedError: cannot open virtualCSharp-razor:/Path/ToFile/Component.razor__virtual.cs. Detail: Unable to resolve resource virtualCSharp-razor:/Path/ToFile/Component.razor__virtual.cs
All of this works on Windows now, but not on Mac for some reason. All of the files are in my workspace.
EDIT: Updating .NET SDK partially fixed the issue, now I'm back at the same state as my previous screenshot (Working on Windows, some components still unrecognized on Mac).