Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The name 'route data' does not exist #11190

Open
Dieguitico opened this issue Nov 9, 2024 · 2 comments
Open

The name 'route data' does not exist #11190

Dieguitico opened this issue Nov 9, 2024 · 2 comments

Comments

@Dieguitico
Copy link

Dieguitico commented Nov 9, 2024

I am trying to implement authorization to my project. I have this as part of my configuration in my App.razor

@using Microsoft.AspNetCore.Components.Routing

Router AppAssembly="@typeof(Program).Assembly"
Found Context="routeData"
RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)"
FocusOnNavigate RouteData="@routeData" Selector="h1"
Found
NotFound
PageTitle>Not Found</PageTitle
LayoutView Layout="@typeof(MainLayout)"
p role="alert">Sorry, there's nothing at this address.</p
LayoutView
NotFound
Router

I keep getting these error messages.

Severity Code Description Project File Line Suppression State Details
Error (active) RZ9985 Multiple components use the tag 'RouteView'. Components: Management_Cases.RouteView, Microsoft.AspNetCore.Components.RouteView Management Cases

Severity Code Description Project File Line Suppression State Details
Error (active) CS0103 The name 'routeData' does not exist in the current context

Severity Code Description Project File Line Suppression State Details
Error (active) CS0103 The name 'routeData' does not exist in the current context

I tried everything but the issue persists. Any help would be appreciated.

@phil-allen-msft
Copy link
Contributor

We're sorry you are running into this. From the error message, it appears that you may have a RouteView.razor in your project, and the ASP.NET Core you are referencing also seems to have a class of the same name. Does that represent the content of your project? Does renaming that RouteView.razor, or using a qualified path for the @using and component name, get you the desired behavior?

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 7 days. It will be closed if no further activity occurs within 7 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

Please see our Issue Management Policies for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants