Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Upgrading Blazor from 3.1 to 5.0 "does not have a property matching the name 'PreferExactMatches'"

As per the migration document here it recommends to add this property PreferExactMatches

enter image description here

When I do I get this error

InvalidOperationException: Object of type 'Microsoft.AspNetCore.Components.Routing.Router' does not have a property matching the name 'PreferExactMatches'.

Even the API explorer says the property isn't there. Am I missing anything in here? Please suggest. For now I am skipping it and its working.

like image 398
Arjun Shetty Avatar asked Dec 01 '20 06:12

Arjun Shetty


People also ask

Which component is used in the app component of Blazor?

The Router component is used in the App component of Blazor apps. When a Razor component ( .razor) with an @page directive is compiled, the generated component class is provided a RouteAttribute specifying the component's route template.

How does Blazor server work with mapblazorhub?

Blazor Server is integrated into ASP.NET Core Endpoint Routing. An ASP.NET Core app is configured to accept incoming connections for interactive components with MapBlazorHub in Program.cs: The typical configuration is to route all requests to a Razor page, which acts as the host for the server-side part of the Blazor Server app.

What happens when a code fails in Blazor server?

Otherwise, the failing code results in an unhandled exception that's fatal to a Blazor Server circuit. By default, calls to InvokeAsync must complete within a certain period or else the call times out. The default timeout period is one minute.

How does Blazor manage unhandled exceptions?

This article describes how Blazor manages unhandled exceptions and how to develop apps that detect and handle errors. When a Blazor app isn't functioning properly during development, receiving detailed error information from the app assists in troubleshooting and fixing the issue.


2 Answers

The MS migration document was in front of the patch release. (The document is edited in the meantime). The property PreferExactMatches is not yet released, but will be next days.

https://github.com/dotnet/AspNetCore.Docs/issues/20838

like image 198
yannik Avatar answered Oct 25 '22 20:10

yannik


I believe the "PreferExactMatches" is something to do with 5.0.1 sdk patch.

SDK : https://dotnet.microsoft.com/download/visual-studio-sdks

blog post : https://learn.microsoft.com/en-us/aspnet/core/migration/31-to-50?view=aspnetcore-5.0&tabs=visual-studio

like image 36
David Masterson Avatar answered Oct 25 '22 21:10

David Masterson