Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/aspnetcore.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Calvarro Nelson <jacalvar@microsoft.com>2020-12-02 01:40:10 +0300
committerGitHub <noreply@github.com>2020-12-02 01:40:10 +0300
commitfc93e595ceffbb1e3e85532bf454e92a6a80dd6b (patch)
tree508cb1c7af313f2d125b700a22e4869461573a02
parentf255fad9426fc8877111fb434cc4b8ded125e9a7 (diff)
[Blazor] Update template to pass in attribute as boolean (#28285)v5.0.1
Description We introduced a public property as part of #27907 to enable users to opt-in. Turns out that this caused issues since we didn't update the target pack. As a result, the Razor compiler treats this new property as a regular HTML attribute (of type string) instead of as a boolean. In turn this causes the template to error at runtime when the application starts. Customer Impact Customers using 5.0.1 won't be able to create and run new blazor apps out of the box. They can fix the template code by preceding the true value in the attribute with @ to force the compiler to interpret it as C#. (Which is the same fix we are applying). Regression? Yes, 5.0.0. Users were able to create new blazor templates without this issue. Risk Low. We've manually validated the fix against a new project from a 5.0.1 template.
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/App.razor4
-rw-r--r--src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/App.razor4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/App.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/App.razor
index a7210c9197..0e1ea89371 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/App.razor
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/App.razor
@@ -1,5 +1,5 @@
@*#if (NoAuth)
-<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="true">
+<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
@@ -11,7 +11,7 @@
</Router>
#else
<CascadingAuthenticationState>
- <Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="true">
+ <Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/App.razor b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/App.razor
index f0d75aaa2a..9cbaddae54 100644
--- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/App.razor
+++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/App.razor
@@ -1,5 +1,5 @@
@*#if (NoAuth)
-<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="true">
+<Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
</Found>
@@ -11,7 +11,7 @@
</Router>
#else
<CascadingAuthenticationState>
- <Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="true">
+ <Router AppAssembly="@typeof(Program).Assembly" PreferExactMatches="@true">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
<NotAuthorized>