Skip to content

Commit

Permalink
Upgrade to .NET 9; Enable CPM (#199)
Browse files Browse the repository at this point in the history
* Upgrade to .NET 9.0

* Migrate to central package manager

* Upgrade NuGet packages to latest version

* Clean up package references

* Use MapStaticAssets instead of UseStaticFiles

* Clean up

* Clean up

* Pin vulnerable packages

* Clean build props; update copyright notice

* Update build pipelines to .NET 9

* Update README.MD

* Remove Azure DevOps pipelines
  • Loading branch information
rhyskoedijk authored Nov 23, 2024
1 parent daba674 commit cab1561
Show file tree
Hide file tree
Showing 71 changed files with 539 additions and 913 deletions.
75 changes: 0 additions & 75 deletions .azure/pipelines/devops-pipeline-build-publish.yml

This file was deleted.

49 changes: 0 additions & 49 deletions .azure/pipelines/devops-pipeline-build-test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/github-action-build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Build and deploy solution to Azure

env:
DOTNET_VERSION: '8.0.x'
DOTNET_VERSION: '9.0.x'

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/github-action-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Build and test solution

env:
DOTNET_VERSION: '8.0.x'
DOTNET_VERSION: '9.0.x'

on:
pull_request:
Expand Down
36 changes: 36 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Project>

<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>true</ImplicitUsings>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup>
<Authors>Rhys Koedijk</Authors>
<Description>Steam Community Market Manager (SCMM)</Description>
<Copyright>Copyright © 2021-2024 Rhys Koedijk</Copyright>
</PropertyGroup>

<!--
Use ReferenceTrimmer to escalate "unnesscary reference" warnings as errors; Reduces project and package bloat.
https://github.com/dfederm/ReferenceTrimmer
-->
<PropertyGroup>
<!-- Generation file must be enabled to get accurate results when using ReferenceTimmer -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!-- Suppress XML doc comment issues to avoid errors when using ReferenceTrimmer -->
<NoWarn>$(NoWarn);CS0419;CS1570;CS1573;CS1574;CS1584;CS1591;SA1602</NoWarn>
<!--
Escalate warnings to errors for:
IDE0005: Remove unnecessary using directives
RT0000: Enable documentation generation for accuracy of used references detection
RT0001: Unnecessary reference
RT0002: Unnecessary project reference
RT0003: Unnecessary package reference
-->
<WarningsAsErrors>$(WarningsAsErrors);IDE0005;RT0000;RT0001;RT0002;RT0003</WarningsAsErrors>
<MSBuildWarningsAsErrors>$(WarningsAsErrors)</MSBuildWarningsAsErrors>
</PropertyGroup>

</Project>
85 changes: 85 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup>
<GlobalPackageReference Include="ReferenceTrimmer" Version="3.3.10" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="AspNet.Security.OpenId.Steam" Version="9.0.0" />
<PackageVersion Include="AutoMapper" Version="13.0.1" />
<PackageVersion Include="Azure.AI.TextAnalytics" Version="5.3.0" />
<PackageVersion Include="Azure.Identity" Version="1.13.1" />
<PackageVersion Include="Azure.Messaging.ServiceBus" Version="7.18.2" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.23.0" />
<PackageVersion Include="Blazored.LocalStorage" Version="4.5.0" />
<PackageVersion Include="BlazorIntersectionObserver" Version="3.1.0" />
<PackageVersion Include="CommandQuery" Version="1.0.0" />
<PackageVersion Include="CommandQuery.DependencyInjection" Version="1.0.0" />
<PackageVersion Include="Coravel" Version="6.0.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="DiffPlex" Version="1.7.2" />
<PackageVersion Include="Discord.Net" Version="3.16.0" />
<PackageVersion Include="DocumentFormat.OpenXml" Version="3.1.1" />
<PackageVersion Include="Google.Apis.YouTube.v3" Version="1.68.0.3596" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.71" />
<PackageVersion Include="Markdig" Version="0.38.0" />
<PackageVersion Include="Microsoft.ApplicationInsights" Version="2.22.0" />
<PackageVersion Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics" Version="2.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
<PackageVersion Include="Microsoft.Azure.CognitiveServices.Vision.ComputerVision" Version="7.0.1" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker" Version="2.0.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.ServiceBus" Version="5.22.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Storage" Version="6.6.0" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Timer" Version="4.3.1" />
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Cosmos" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
<PackageVersion Include="Microsoft.Identity.Web.UI" Version="3.4.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="MudBlazor" Version="6.20.0" />
<PackageVersion Include="Polly" Version="8.5.0" />
<PackageVersion Include="Polly.Extensions.Http" Version="3.0.0" />
<PackageVersion Include="SixLabors.Fonts" Version="2.0.6" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.5" />
<PackageVersion Include="SixLabors.ImageSharp.Drawing" Version="2.1.4" />
<PackageVersion Include="SocketIOClient" Version="3.1.2" />
<PackageVersion Include="StackExchange.Redis" Version="2.8.16" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="7.0.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.Annotations" Version="7.0.0" />
<PackageVersion Include="Swashbuckle.AspNetCore.Filters" Version="8.0.2" />
<PackageVersion Include="Syncfusion.Blazor.Charts" Version="27.2.2" />
<PackageVersion Include="Syncfusion.Blazor.Themes" Version="27.2.2" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>
<ItemGroup>
<!-- Vulnerable transitive packages; Pin to the next non-vulnerable version -->
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
<PackageVersion Include="System.Text.Encodings.Web" Version="9.0.0" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Microsoft.Rest.ClientRuntime" Version="2.3.24" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ SCMM started as a personal project to gain practical and hands-on experience usi
TODO: Document this...

You will need:
- [Visual Studio](https://visualstudio.microsoft.com/vs/community/) (2022/v17.7+) with the following workloads and components installed:
- [Visual Studio](https://visualstudio.microsoft.com/vs/community/) (2022/v17.13+) with the following workloads and components installed:
- ASP.NET and web development
- .NET SDK
- .NET 7.0 Runtime
- .NET 7.0 WebAssembly Build Tools
- .NET 9.0 Runtime
- .NET 9.0 WebAssembly Build Tools
- Azure development
- Azure Compute Emulator
- [Azure Storage Emulator](https://learn.microsoft.com/en-us/azure/storage/common/storage-use-emulator#get-the-storage-emulator)
Expand Down
16 changes: 4 additions & 12 deletions SCMM.Azure.AI/SCMM.Azure.AI.csproj
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.AI.TextAnalytics" Version="5.3.0" />
<PackageReference Include="Microsoft.Azure.CognitiveServices.Vision.ComputerVision" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageReference Include="Azure.AI.TextAnalytics" />
<PackageReference Include="Microsoft.Azure.CognitiveServices.Vision.ComputerVision" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SCMM.Shared.Abstractions\SCMM.Shared.Abstractions.csproj" />
</ItemGroup>

</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.22.0" />
<PackageReference Include="Microsoft.ApplicationInsights" />
</ItemGroup>

</Project>
</Project>
18 changes: 5 additions & 13 deletions SCMM.Azure.ServiceBus/SCMM.Azure.ServiceBus.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.18.2" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="Azure.Messaging.ServiceBus" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SCMM.Shared.Abstractions\SCMM.Shared.Abstractions.csproj" />
<ProjectReference Include="..\SCMM.Shared.Data.Models\SCMM.Shared.Data.Models.csproj" />
</ItemGroup>

</Project>
</Project>
13 changes: 2 additions & 11 deletions SCMM.Discord.API/SCMM.Discord.API.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommandQuery" Version="1.0.0" />
<PackageReference Include="CommandQuery" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SCMM.Discord.Data.Models\SCMM.Discord.Data.Models.csproj" />
<ProjectReference Include="..\SCMM.Shared.Abstractions\SCMM.Shared.Abstractions.csproj" />
</ItemGroup>

</Project>
</Project>
2 changes: 1 addition & 1 deletion SCMM.Discord.Bot.Server/Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<footer class="border-top footer bg-dark">
<div class="container">
&copy; 2021 Rhys Koedijk
&copy; 2021-2024 Rhys Koedijk
</div>
</footer>

Expand Down
3 changes: 2 additions & 1 deletion SCMM.Discord.Bot.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,14 @@ public static WebApplication Configure(this WebApplication app)
}

app.UseHttpsRedirection();
app.UseStaticFiles();

app.UseRouting();

app.UseAuthentication();
app.UseAuthorization();

app.MapStaticAssets();

app.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}"
Expand Down
Loading

0 comments on commit cab1561

Please sign in to comment.