Skip to content

Commit bedb668

Browse files
committed
Feedback: use sdk for setting the switch.
1 parent 48b88db commit bedb668

File tree

3 files changed

+1
-3
lines changed

3 files changed

+1
-3
lines changed

src/ProjectTemplates/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<PropertyGroup>
55
<!-- The .csproj files in this folder do not actually produce .dll's. They are only present to produce .nupkgs and enable Visual Studio support -->
66
<IsProjectReferenceProvider>false</IsProjectReferenceProvider>
7+
<DisableThrowNavigationException>true</DisableThrowNavigationException>
78
</PropertyGroup>
89

910
<Import Project="TemplateProjects.props" Condition=" !$(IsTestProject) AND '$(IsTestAssetProject)' != 'true'" />

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Program.Main.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public class Program
2020
{
2121
public static void Main(string[] args)
2222
{
23-
System.AppContext.SetSwitch("Microsoft.AspNetCore.Components.Endpoints.NavigationManager.DisableThrowNavigationException", true);
2423
var builder = WebApplication.CreateBuilder(args);
2524

2625
// Add services to the container.

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorWeb-CSharp/BlazorWeb-CSharp/Program.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
using BlazorWeb_CSharp.Data;
1515
#endif
1616

17-
System.AppContext.SetSwitch("Microsoft.AspNetCore.Components.Endpoints.NavigationManager.DisableThrowNavigationException", true);
18-
1917
var builder = WebApplication.CreateBuilder(args);
2018

2119
// Add services to the container.

0 commit comments

Comments
 (0)