Skip to content

Commit b151ec3

Browse files
committed
Update projects
1 parent 523acf7 commit b151ec3

File tree

4 files changed

+39
-35
lines changed

4 files changed

+39
-35
lines changed

DeviceFlowWeb/DeviceFlowWeb.csproj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@
77
<ImplicitUsings>true</ImplicitUsings>
88
</PropertyGroup>
99

10+
<PropertyGroup>
11+
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\css\site.min.css;wwwroot\css\vendor.min.css;wwwroot\js\site.min.js;wwwroot\js\vendor-validation.min.js;wwwroot\js\vendor.min.js</DefaultItemExcludes>
12+
</PropertyGroup>
1013

1114
<ItemGroup>
12-
<PackageReference Include="BuildBundlerMinifier" Version="3.2.449" />
13-
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.0" />
15+
<PackageReference Include="BuildBundlerMinifier" Version="3.2.449" />
16+
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.0" />
1417
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
1518
<PackageReference Include="IdentityModel" Version="7.0.0" />
1619
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
@@ -25,7 +28,7 @@
2528
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders.TagHelpers" Version="1.0.0-preview.1" />
2629
<PackageReference Include="System.Text.Json" Version="9.0.0" />
2730
</ItemGroup>
28-
31+
2932
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('node_modules') ">
3033
<!-- Ensure Node.js is installed -->
3134
<Exec Command="node --version" ContinueOnError="true">
0 Bytes
Binary file not shown.
Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

3-
<PropertyGroup>
4-
<TargetFramework>net9.0</TargetFramework>
5-
<ImplicitUsings>enable</ImplicitUsings>
6-
<UserSecretsId>55674afb-fac9-407f-898f-6a543e9d137a</UserSecretsId>
7-
</PropertyGroup>
3+
<PropertyGroup>
4+
<TargetFramework>net9.0</TargetFramework>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
<UserSecretsId>55674afb-fac9-407f-898f-6a543e9d137a</UserSecretsId>
7+
</PropertyGroup>
88

9-
<ItemGroup>
10-
<PackageReference Include="Duende.IdentityServer.AspNetIdentity" Version="7.0.8" />
11-
<PackageReference Include="Fido2" Version="3.0.1" />
12-
<PackageReference Include="BuildBundlerMinifier" Version="3.2.449" />
13-
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="9.0.0" />
14-
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.0" />
15-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
16-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
17-
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
18-
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
19-
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.0" />
20-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.0" />
21-
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="9.0.0" />
22-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
23-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
24-
<PrivateAssets>all</PrivateAssets>
25-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
26-
</PackageReference>
27-
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" Version="1.0.0-preview.1" />
28-
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders.TagHelpers" Version="1.0.0-preview.1" />
29-
<PackageReference Include="System.Text.Json" Version="9.0.0" />
30-
</ItemGroup>
9+
<PropertyGroup>
10+
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\css\site.min.css;wwwroot\css\vendor.min.css;wwwroot\js\site.min.js;wwwroot\js\vendor-validation.min.js;wwwroot\js\vendor.min.js</DefaultItemExcludes>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="Duende.IdentityServer.AspNetIdentity" Version="7.0.8" />
15+
<PackageReference Include="Fido2" Version="3.0.1" />
16+
<PackageReference Include="BuildBundlerMinifier" Version="3.2.449" />
17+
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="9.0.0" />
18+
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.0" />
19+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
20+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="9.0.0" />
21+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
22+
<PackageReference Include="Serilog.AspNetCore" Version="8.0.3" />
23+
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.0" />
24+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.0" />
25+
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="9.0.0" />
26+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0" />
27+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0">
28+
<PrivateAssets>all</PrivateAssets>
29+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
30+
</PackageReference>
31+
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" Version="1.0.0-preview.1" />
32+
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders.TagHelpers" Version="1.0.0-preview.1" />
33+
<PackageReference Include="System.Text.Json" Version="9.0.0" />
34+
</ItemGroup>
3135
</Project>

WebApi/HostingExtensions.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,16 @@ namespace WebApi;
99

1010
internal static class HostingExtensions
1111
{
12-
private static IWebHostEnvironment? _env;
13-
1412
public static WebApplication ConfigureServices(this WebApplicationBuilder builder)
1513
{
1614
var services = builder.Services;
1715
var configuration = builder.Configuration;
18-
_env = builder.Environment;
1916

2017
services.AddSecurityHeaderPolicies()
2118
.SetPolicySelector((PolicySelectorContext ctx) =>
2219
{
2320
return SecurityHeadersDefinitions.GetHeaderPolicyCollection(
24-
_env!.IsDevelopment());
21+
builder.Environment.IsDevelopment());
2522
});
2623

2724
services.Configure<CookiePolicyOptions>(options =>
@@ -100,7 +97,7 @@ public static WebApplication ConfigurePipeline(this WebApplication app)
10097

10198
app.UseSecurityHeaders();
10299

103-
if (_env!.IsDevelopment())
100+
if (app.Environment.IsDevelopment())
104101
{
105102
app.UseDeveloperExceptionPage();
106103

0 commit comments

Comments
 (0)