Skip to content

Commit c67f90c

Browse files
committed
Updated 0308 after stream
1 parent 3a247d9 commit c67f90c

File tree

150 files changed

+1843
-56
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+1843
-56
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/azds.yaml
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/Dockerfile*
19+
**/node_modules
20+
**/npm-debug.log
21+
**/obj
22+
**/secrets.dev.yaml
23+
**/values.dev.yaml
24+
LICENSE
25+
README.md

sessions/Season-03/0308-HostingAndDeployment/BlazorHosted/BlazorHosted.sln

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio Version 16
3-
VisualStudioVersion = 16.0.0.0
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.1.32210.238
44
MinimumVisualStudioVersion = 16.0.0.0
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorHosted.Server", "Server\BlazorHosted.Server.csproj", "{83D642E6-184F-4CE1-868D-F0D9CAD98292}"
66
EndProject
@@ -18,18 +18,6 @@ Global
1818
Release|x86 = Release|x86
1919
EndGlobalSection
2020
GlobalSection(ProjectConfigurationPlatforms) = postSolution
21-
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
22-
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
23-
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Debug|x64.ActiveCfg = Debug|Any CPU
24-
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Debug|x64.Build.0 = Debug|Any CPU
25-
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Debug|x86.ActiveCfg = Debug|Any CPU
26-
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Debug|x86.Build.0 = Debug|Any CPU
27-
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
28-
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Release|Any CPU.Build.0 = Release|Any CPU
29-
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Release|x64.ActiveCfg = Release|Any CPU
30-
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Release|x64.Build.0 = Release|Any CPU
31-
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Release|x86.ActiveCfg = Release|Any CPU
32-
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Release|x86.Build.0 = Release|Any CPU
3321
{83D642E6-184F-4CE1-868D-F0D9CAD98292}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3422
{83D642E6-184F-4CE1-868D-F0D9CAD98292}.Debug|Any CPU.Build.0 = Debug|Any CPU
3523
{83D642E6-184F-4CE1-868D-F0D9CAD98292}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -42,6 +30,18 @@ Global
4230
{83D642E6-184F-4CE1-868D-F0D9CAD98292}.Release|x64.Build.0 = Release|Any CPU
4331
{83D642E6-184F-4CE1-868D-F0D9CAD98292}.Release|x86.ActiveCfg = Release|Any CPU
4432
{83D642E6-184F-4CE1-868D-F0D9CAD98292}.Release|x86.Build.0 = Release|Any CPU
33+
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34+
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
35+
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Debug|x64.ActiveCfg = Debug|Any CPU
36+
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Debug|x64.Build.0 = Debug|Any CPU
37+
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Debug|x86.ActiveCfg = Debug|Any CPU
38+
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Debug|x86.Build.0 = Debug|Any CPU
39+
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
40+
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Release|Any CPU.Build.0 = Release|Any CPU
41+
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Release|x64.ActiveCfg = Release|Any CPU
42+
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Release|x64.Build.0 = Release|Any CPU
43+
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Release|x86.ActiveCfg = Release|Any CPU
44+
{60288A61-CBB8-4862-A0E0-180AE5520D9A}.Release|x86.Build.0 = Release|Any CPU
4545
{6729AB68-C191-42F3-81C9-CF7A9C46963A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4646
{6729AB68-C191-42F3-81C9-CF7A9C46963A}.Debug|Any CPU.Build.0 = Debug|Any CPU
4747
{6729AB68-C191-42F3-81C9-CF7A9C46963A}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -61,4 +61,4 @@ Global
6161
GlobalSection(ExtensibilityGlobals) = postSolution
6262
SolutionGuid = {47CB29EC-6281-41B8-AB6B-534D3B7CE7E0}
6363
EndGlobalSection
64-
EndGlobal
64+
EndGlobal

sessions/Season-03/0308-HostingAndDeployment/BlazorHosted/Server/BlazorHosted.Server.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
<TargetFramework>net6.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
7+
<UserSecretsId>bae6f05a-fe31-4807-bb04-e675002740bd</UserSecretsId>
8+
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
79
</PropertyGroup>
810

911
<ItemGroup>
1012
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.2" />
13+
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
1114
</ItemGroup>
1215

1316
<ItemGroup>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
2+
3+
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
4+
WORKDIR /app
5+
EXPOSE 80
6+
EXPOSE 443
7+
8+
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
9+
WORKDIR /src
10+
COPY ["Server/BlazorHosted.Server.csproj", "Server/"]
11+
COPY ["Shared/BlazorHosted.Shared.csproj", "Shared/"]
12+
COPY ["Client/BlazorHosted.Client.csproj", "Client/"]
13+
RUN dotnet restore "Server/BlazorHosted.Server.csproj"
14+
COPY . .
15+
WORKDIR "/src/Server"
16+
RUN dotnet build "BlazorHosted.Server.csproj" -c Release -o /app/build
17+
18+
FROM build AS publish
19+
RUN dotnet publish "BlazorHosted.Server.csproj" -c Release -o /app/publish
20+
21+
FROM base AS final
22+
WORKDIR /app
23+
COPY --from=publish /app/publish .
24+
ENTRYPOINT ["dotnet", "BlazorHosted.Server.dll"]
Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,37 @@
11
{
2-
"iisSettings": {
3-
"windowsAuthentication": false,
4-
"anonymousAuthentication": true,
5-
"iisExpress": {
6-
"applicationUrl": "http://localhost:5325",
7-
"sslPort": 44353
8-
}
2+
"iisSettings": {
3+
"windowsAuthentication": false,
4+
"anonymousAuthentication": true,
5+
"iisExpress": {
6+
"applicationUrl": "http://localhost:5325",
7+
"sslPort": 44353
8+
}
9+
},
10+
"profiles": {
11+
"BlazorHosted.Server": {
12+
"commandName": "Project",
13+
"launchBrowser": true,
14+
"environmentVariables": {
15+
"ASPNETCORE_ENVIRONMENT": "Development"
16+
},
17+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
18+
"applicationUrl": "https://localhost:7231;http://localhost:5029",
19+
"dotnetRunMessages": true
920
},
10-
"profiles": {
11-
"BlazorHosted.Server": {
12-
"commandName": "Project",
13-
"dotnetRunMessages": true,
14-
"launchBrowser": true,
15-
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
16-
"applicationUrl": "https://localhost:7231;http://localhost:5029",
17-
"environmentVariables": {
18-
"ASPNETCORE_ENVIRONMENT": "Development"
19-
}
21+
"IIS Express": {
22+
"commandName": "IISExpress",
23+
"launchBrowser": true,
24+
"environmentVariables": {
25+
"ASPNETCORE_ENVIRONMENT": "Development"
2026
},
21-
"IIS Express": {
22-
"commandName": "IISExpress",
23-
"launchBrowser": true,
24-
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
25-
"environmentVariables": {
26-
"ASPNETCORE_ENVIRONMENT": "Development"
27-
}
28-
}
27+
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}"
28+
},
29+
"Docker": {
30+
"commandName": "Docker",
31+
"launchBrowser": true,
32+
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}",
33+
"publishAllPorts": true,
34+
"useSSL": true
2935
}
3036
}
37+
}

sessions/Season-03/0308-HostingAndDeployment/BlazorPwa/BlazorPwa.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
16+
<ServiceWorker Include="wwwroot\service-worker.js"
17+
PublishedContent="wwwroot\service-worker.published.js" />
1718
</ItemGroup>
1819

1920
</Project>

sessions/Season-03/0308-HostingAndDeployment/BlazorPwa/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
builder.RootComponents.Add<App>("#app");
77
builder.RootComponents.Add<HeadOutlet>("head::after");
88

9-
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
9+
builder.Services.AddScoped(sp => new HttpClient {
10+
BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)
11+
});
1012

1113
await builder.Build().RunAsync();
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration>
3+
<system.webServer>
4+
<staticContent>
5+
<remove fileExtension=".blat" />
6+
<remove fileExtension=".dat" />
7+
<remove fileExtension=".dll" />
8+
<remove fileExtension=".json" />
9+
<remove fileExtension=".wasm" />
10+
<remove fileExtension=".woff" />
11+
<remove fileExtension=".woff2" />
12+
<mimeMap fileExtension=".blat" mimeType="application/octet-stream" />
13+
<mimeMap fileExtension=".dll" mimeType="application/octet-stream" />
14+
<mimeMap fileExtension=".dat" mimeType="application/octet-stream" />
15+
<mimeMap fileExtension=".json" mimeType="application/json" />
16+
<mimeMap fileExtension=".wasm" mimeType="application/wasm" />
17+
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
18+
<mimeMap fileExtension=".woff2" mimeType="application/font-woff" />
19+
</staticContent>
20+
<httpCompression>
21+
<dynamicTypes>
22+
<add mimeType="application/octet-stream" enabled="true" />
23+
<add mimeType="application/wasm" enabled="true" />
24+
</dynamicTypes>
25+
</httpCompression>
26+
<rewrite>
27+
<rules>
28+
<rule name="Serve subdir">
29+
<match url=".*" />
30+
<action type="Rewrite" url="wwwroot\{R:0}" />
31+
</rule>
32+
<rule name="SPA fallback routing" stopProcessing="true">
33+
<match url=".*" />
34+
<conditions logicalGrouping="MatchAll">
35+
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
36+
</conditions>
37+
<action type="Rewrite" url="wwwroot\" />
38+
</rule>
39+
</rules>
40+
</rewrite>
41+
</system.webServer>
42+
</configuration>
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
/* /Shared/MainLayout.razor.rz.scp.css */
2+
.page[b-d1r2kchabk] {
3+
position: relative;
4+
display: flex;
5+
flex-direction: column;
6+
}
7+
8+
main[b-d1r2kchabk] {
9+
flex: 1;
10+
}
11+
12+
.sidebar[b-d1r2kchabk] {
13+
background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%);
14+
}
15+
16+
.top-row[b-d1r2kchabk] {
17+
background-color: #f7f7f7;
18+
border-bottom: 1px solid #d6d5d5;
19+
justify-content: flex-end;
20+
height: 3.5rem;
21+
display: flex;
22+
align-items: center;
23+
}
24+
25+
.top-row[b-d1r2kchabk] a, .top-row[b-d1r2kchabk] .btn-link {
26+
white-space: nowrap;
27+
margin-left: 1.5rem;
28+
text-decoration: none;
29+
}
30+
31+
.top-row[b-d1r2kchabk] a:hover, .top-row[b-d1r2kchabk] .btn-link:hover {
32+
text-decoration: underline;
33+
}
34+
35+
.top-row[b-d1r2kchabk] a:first-child {
36+
overflow: hidden;
37+
text-overflow: ellipsis;
38+
}
39+
40+
@media (max-width: 640.98px) {
41+
.top-row:not(.auth)[b-d1r2kchabk] {
42+
display: none;
43+
}
44+
45+
.top-row.auth[b-d1r2kchabk] {
46+
justify-content: space-between;
47+
}
48+
49+
.top-row[b-d1r2kchabk] a, .top-row[b-d1r2kchabk] .btn-link {
50+
margin-left: 0;
51+
}
52+
}
53+
54+
@media (min-width: 641px) {
55+
.page[b-d1r2kchabk] {
56+
flex-direction: row;
57+
}
58+
59+
.sidebar[b-d1r2kchabk] {
60+
width: 250px;
61+
height: 100vh;
62+
position: sticky;
63+
top: 0;
64+
}
65+
66+
.top-row[b-d1r2kchabk] {
67+
position: sticky;
68+
top: 0;
69+
z-index: 1;
70+
}
71+
72+
.top-row.auth[b-d1r2kchabk] a:first-child {
73+
flex: 1;
74+
text-align: right;
75+
width: 0;
76+
}
77+
78+
.top-row[b-d1r2kchabk], article[b-d1r2kchabk] {
79+
padding-left: 2rem !important;
80+
padding-right: 1.5rem !important;
81+
}
82+
}
83+
/* /Shared/NavMenu.razor.rz.scp.css */
84+
.navbar-toggler[b-xvwp29f831] {
85+
background-color: rgba(255, 255, 255, 0.1);
86+
}
87+
88+
.top-row[b-xvwp29f831] {
89+
height: 3.5rem;
90+
background-color: rgba(0,0,0,0.4);
91+
}
92+
93+
.navbar-brand[b-xvwp29f831] {
94+
font-size: 1.1rem;
95+
}
96+
97+
.oi[b-xvwp29f831] {
98+
width: 2rem;
99+
font-size: 1.1rem;
100+
vertical-align: text-top;
101+
top: -2px;
102+
}
103+
104+
.nav-item[b-xvwp29f831] {
105+
font-size: 0.9rem;
106+
padding-bottom: 0.5rem;
107+
}
108+
109+
.nav-item:first-of-type[b-xvwp29f831] {
110+
padding-top: 1rem;
111+
}
112+
113+
.nav-item:last-of-type[b-xvwp29f831] {
114+
padding-bottom: 1rem;
115+
}
116+
117+
.nav-item[b-xvwp29f831] a {
118+
color: #d7d7d7;
119+
border-radius: 4px;
120+
height: 3rem;
121+
display: flex;
122+
align-items: center;
123+
line-height: 3rem;
124+
}
125+
126+
.nav-item[b-xvwp29f831] a.active {
127+
background-color: rgba(255,255,255,0.25);
128+
color: white;
129+
}
130+
131+
.nav-item[b-xvwp29f831] a:hover {
132+
background-color: rgba(255,255,255,0.1);
133+
color: white;
134+
}
135+
136+
@media (min-width: 641px) {
137+
.navbar-toggler[b-xvwp29f831] {
138+
display: none;
139+
}
140+
141+
.collapse[b-xvwp29f831] {
142+
/* Never collapse the sidebar for wide screens */
143+
display: block;
144+
}
145+
}

0 commit comments

Comments
 (0)