Early this month I started a new ASP.NET Core application, which I'm writing in .NET 8. I used this because I've got to use Windows Authentication. However, I also want to learn Blazor, so I added that to the project.
Now I'm gettings errors in the RouteView.razor file and the Routes.razor file. Here's the RouteView.razor file:
<RouteView RouteData="routeData" DefaultLayout="typeof(MainLayout)" />
The errors it is raising are:
- RZ9985 Multiple components use the tag 'RouteView' (two of this error)
- CS1061 'RouteView' does not contain a definition for 'RouteData' and no accessible extension method 'RouteData' accepting a first argument of type 'RouteView' could be found
- CS0103 The name 'routeData' does not exist in the current context (two of this error)
- CS1061 'RouteView' does not contain a definition for 'DefaultLayout' and no accessible extension method 'DefaultLayout' accepting a first argument of type 'RouteView' could be found
- CS0246 The type or namespace name 'MainLayout' could not be found (two of this error)
And here's what's in the Routes.razor file:
<Router AppAssembly="typeof(Program).Assembly">
<Found Context="routeData">
<RouteView RouteData="routeData" />
<FocusOnNavigate RouteData="routeData" Selector="h1" />
</Found>
</Router>
And the error its raising is:- RZ9985 Multiple components use the tag 'RouteView'
I'm not sure why it is raising these errors. I am still too new to Blazor. Is it because I created the ASP.NET Core project first, then added Blazor?