Skip to content

Commit c666b81

Browse files
authored
Fix Client projects in Web App templates (#4328)
1 parent fc0a0e5 commit c666b81

File tree

8 files changed

+43
-2
lines changed

8 files changed

+43
-2
lines changed

src/Templates/templates/blazorweb-csharp-10/BlazorWebCSharp.1.Client/Program.Main.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
2+
#if (UseWebAssembly)
3+
using Microsoft.FluentUI.AspNetCore.Components;
4+
#endif
25

36
namespace BlazorWebCSharp._1.Client;
47

@@ -12,8 +15,12 @@ static async Task Main(string[] args)
1215
builder.Services.AddAuthorizationCore();
1316
builder.Services.AddCascadingAuthenticationState();
1417
builder.Services.AddAuthenticationStateDeserialization();
18+
#endif
1519

20+
#if (UseWebAssembly)
21+
builder.Services.AddFluentUIComponents();
1622
#endif
23+
1724
await builder.Build().RunAsync();
1825
}
1926
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
2+
#if (UseWebAssembly)
3+
using Microsoft.FluentUI.AspNetCore.Components;
4+
#endif
25

36
var builder = WebAssemblyHostBuilder.CreateDefault(args);
47

58
#if (IndividualLocalAuth)
69
builder.Services.AddAuthorizationCore();
710
builder.Services.AddCascadingAuthenticationState();
811
builder.Services.AddAuthenticationStateDeserialization();
12+
#endif
913

14+
#if (UseWebAssembly)
15+
builder.Services.AddFluentUIComponents();
1016
#endif
17+
1118
await builder.Build().RunAsync();

src/Templates/templates/blazorweb-csharp-10/BlazorWebCSharp.1/Components/_Imports.razor

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
@using BlazorWebCSharp._1
1515
@*#if (UseWebAssembly) -->
1616
@using BlazorWebCSharp._1.Client
17-
##endif*@
18-
@*#if (UseServer && UseWebAssembly && InteractiveAtRoot) -->
1917
@using BlazorWebCSharp._1.Client.Layout
2018
##endif*@
2119
@using BlazorWebCSharp._1.Components

src/Templates/templates/blazorweb-csharp-8/.template.config/template.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@
131131
"exclude": [
132132
"BlazorWeb-CSharp/Components/Account/**",
133133
"BlazorWeb-CSharp/Data/**",
134+
"BlazorWeb-CSharp.Client/PersistentAuthenticationStateProvider.cs",
134135
"BlazorWeb-CSharp.Client/UserInfo.cs",
135136
"BlazorWeb-CSharp.Client/Pages/Auth.razor"
136137
]

src/Templates/templates/blazorweb-csharp-8/BlazorWeb-CSharp.Client/Program.Main.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
using Microsoft.AspNetCore.Components.Authorization;
44
#endif
55
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
6+
#if (UseWebAssembly)
7+
using Microsoft.FluentUI.AspNetCore.Components;
8+
#endif
69

710
namespace BlazorWeb_CSharp.Client;
811

@@ -16,8 +19,12 @@ static async Task Main(string[] args)
1619
builder.Services.AddAuthorizationCore();
1720
builder.Services.AddCascadingAuthenticationState();
1821
builder.Services.AddSingleton<AuthenticationStateProvider, PersistentAuthenticationStateProvider>();
22+
#endif
1923

24+
#if (UseWebAssembly)
25+
builder.Services.AddFluentUIComponents();
2026
#endif
27+
2128
await builder.Build().RunAsync();
2229
}
2330
}

src/Templates/templates/blazorweb-csharp-8/BlazorWeb-CSharp.Client/Program.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@
33
using Microsoft.AspNetCore.Components.Authorization;
44
#endif
55
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
6+
#if (UseWebAssembly)
7+
using Microsoft.FluentUI.AspNetCore.Components;
8+
#endif
69

710
var builder = WebAssemblyHostBuilder.CreateDefault(args);
811

912
#if (IndividualLocalAuth)
1013
builder.Services.AddAuthorizationCore();
1114
builder.Services.AddCascadingAuthenticationState();
1215
builder.Services.AddSingleton<AuthenticationStateProvider, PersistentAuthenticationStateProvider>();
16+
#endif
1317

18+
#if (UseWebAssembly)
19+
builder.Services.AddFluentUIComponents();
1420
#endif
21+
1522
await builder.Build().RunAsync();

src/Templates/templates/blazorweb-csharp-9/BlazorWeb-CSharp.Client/Program.Main.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
2+
#if (UseWebAssembly)
3+
using Microsoft.FluentUI.AspNetCore.Components;
4+
#endif
25

36
namespace BlazorWeb_CSharp.Client;
47

@@ -12,8 +15,12 @@ static async Task Main(string[] args)
1215
builder.Services.AddAuthorizationCore();
1316
builder.Services.AddCascadingAuthenticationState();
1417
builder.Services.AddAuthenticationStateDeserialization();
18+
#endif
1519

20+
#if (UseWebAssembly)
21+
builder.Services.AddFluentUIComponents();
1622
#endif
23+
1724
await builder.Build().RunAsync();
1825
}
1926
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
2+
#if (UseWebAssembly)
3+
using Microsoft.FluentUI.AspNetCore.Components;
4+
#endif
25

36
var builder = WebAssemblyHostBuilder.CreateDefault(args);
47

58
#if (IndividualLocalAuth)
69
builder.Services.AddAuthorizationCore();
710
builder.Services.AddCascadingAuthenticationState();
811
builder.Services.AddAuthenticationStateDeserialization();
12+
#endif
913

14+
#if (UseWebAssembly)
15+
builder.Services.AddFluentUIComponents();
1016
#endif
17+
1118
await builder.Build().RunAsync();

0 commit comments

Comments
 (0)