Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to .NET 9 and consolidate build settings #232

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/sonarcloud-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ jobs:
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"gaepdit_air-web" /o:"gaepdit" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths=coverage.xml /d:sonar.exclusions=src/EfRepository/Migrations/**,src/TestData/**
dotnet build
coverlet .\.artifacts\DomainTests\bin\Debug\net8.0\DomainTests.dll --target "dotnet" --targetargs "test tests/DomainTests --no-build" --exclude "[TestData]*"
coverlet .\.artifacts\EfRepositoryTests\bin\Debug\net8.0\EfRepositoryTests.dll --target "dotnet" --targetargs "test tests/EfRepositoryTests --no-build" --exclude "[TestData]*" --exclude "[EfRepository]AirWeb.EfRepository.Migrations.*" --merge-with "coverage.json"
coverlet .\.artifacts\LocalRepositoryTests\bin\Debug\net8.0\LocalRepositoryTests.dll --target "dotnet" --targetargs "test tests/LocalRepositoryTests --no-build" --exclude "[TestData]*" --merge-with "coverage.json"
coverlet .\.artifacts\AppServicesTests\bin\Debug\net8.0\AppServicesTests.dll --target "dotnet" --targetargs "test tests/AppServicesTests --no-build" --exclude "[TestData]*" --merge-with "coverage.json"
coverlet .\.artifacts\WebAppTests\bin\Debug\net8.0\WebAppTests.dll --target "dotnet" --targetargs "test tests/WebAppTests --no-build" --exclude "[TestData]*" --exclude "[EfRepository]AirWeb.EfRepository.Migrations.*" --merge-with "coverage.json" -f=opencover -o="coverage.xml"
coverlet .\.artifacts\DomainTests\bin\Debug\net9.0\DomainTests.dll --target "dotnet" --targetargs "test tests/DomainTests --no-build" --exclude "[TestData]*"
coverlet .\.artifacts\EfRepositoryTests\bin\Debug\net9.0\EfRepositoryTests.dll --target "dotnet" --targetargs "test tests/EfRepositoryTests --no-build" --exclude "[TestData]*" --exclude "[EfRepository]AirWeb.EfRepository.Migrations.*" --merge-with "coverage.json"
coverlet .\.artifacts\LocalRepositoryTests\bin\Debug\net9.0\LocalRepositoryTests.dll --target "dotnet" --targetargs "test tests/LocalRepositoryTests --no-build" --exclude "[TestData]*" --merge-with "coverage.json"
coverlet .\.artifacts\AppServicesTests\bin\Debug\net9.0\AppServicesTests.dll --target "dotnet" --targetargs "test tests/AppServicesTests --no-build" --exclude "[TestData]*" --merge-with "coverage.json"
coverlet .\.artifacts\WebAppTests\bin\Debug\net9.0\WebAppTests.dll --target "dotnet" --targetargs "test tests/WebAppTests --no-build" --exclude "[TestData]*" --exclude "[EfRepository]AirWeb.EfRepository.Migrations.*" --merge-with "coverage.json" -f=opencover -o="coverage.xml"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
4 changes: 2 additions & 2 deletions .run/Run WebApp.run.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run WebApp" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/src/WebApp/WebApp.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net8.0" />
<option name="LAUNCH_PROFILE_TFM" value="net9.0"/>
<option name="LAUNCH_PROFILE_NAME" value="WebApp" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
<option name="USE_MONO" value="0" />
Expand All @@ -14,4 +14,4 @@
<option name="Build" />
</method>
</configuration>
</component>
</component>
6 changes: 3 additions & 3 deletions .run/Watch WebApp.run.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Watch WebApp" type="RunDotNetWatch" factoryName="RunDotNetWatch">
<option name="exePath" value="$PROJECT_DIR$/.artifacts/WebApp/bin/Debug/net8.0/WebApp.exe" />
<option name="exePath" value="$PROJECT_DIR$/.artifacts/WebApp/bin/Debug/net9.0/WebApp.exe"/>
<option name="programParameters" value="" />
<option name="projectFilePath" value="$PROJECT_DIR$/src/WebApp/WebApp.csproj" />
<option name="projectTfm" value="net8.0" />
<option name="projectTfm" value="net9.0"/>
<option name="restartOnRudeEditEditor" value="true" />
<option name="watchParameters" value="" />
<option name="workingDirectory" value="$PROJECT_DIR$/src/WebApp" />
<method v="2" />
</configuration>
</component>
</component>
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/.artifacts/WebApp/bin/Debug/net8.0/WebApp.dll",
"program": "${workspaceFolder}/.artifacts/WebApp/bin/Debug/net9.0/WebApp.dll",
"args": [],
"cwd": "${workspaceFolder}/src/WebApp",
"stopAtEntry": false,
Expand Down
14 changes: 14 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
<Project>
<PropertyGroup>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup>
<BaseProjectArtifactPath>$(MSBuildThisFileDirectory).artifacts\$(MSBuildProjectName)</BaseProjectArtifactPath>
<BaseOutputPath>$(BaseProjectArtifactPath)\bin\</BaseOutputPath>
<BaseIntermediateOutputPath>$(BaseProjectArtifactPath)\obj\</BaseIntermediateOutputPath>
</PropertyGroup>

<PropertyGroup>
<!-- https://aka.ms/vs-build-acceleration -->
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SonarAnalyzer.CSharp">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>
73 changes: 28 additions & 45 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,58 +4,41 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="AutoMapper" Version="13.0.1" />
<PackageVersion Include="ClosedXML" Version="0.102.2" />
<PackageVersion Include="ClosedXML" Version="0.104.2" />
<PackageVersion Include="Dapper" Version="2.1.35" />
<PackageVersion Include="EfCore.TestSupport" Version="9.0.0" />
<PackageVersion Include="FluentAssertions" Version="[7.0.0,8.0)" />
<PackageVersion Include="FluentValidation.AspNetCore" Version="11.3.0" />
<PackageVersion Include="GaEpd.AppLibrary" Version="5.3.0" />
<PackageVersion Include="GaEpd.AppLibrary" Version="5.4.0" />
<PackageVersion Include="GaEpd.EmailService" Version="1.0.0" />
<PackageVersion Include="GaEpd.FileService" Version="3.1.1" />
<PackageVersion Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageVersion Include="LigerShark.WebOptimizer.Core" Version="3.0.405" />
<PackageVersion Include="JetBrains.Annotations" Version="2024.3.0" />
<PackageVersion Include="LigerShark.WebOptimizer.Core" Version="3.0.433" />
<PackageVersion Include="MailKit" Version="4.5.0" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.4" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.1" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="6.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.1" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="8.0.4" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="9.0.1" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="9.0.1" />
<PackageVersion Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Identity.Web" Version="2.18.1" />
<PackageVersion Include="Microsoft.Identity.Web" Version="3.5.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" />
<PackageVersion Include="Mindscape.Raygun4Net.AspNetCore" Version="10.1.1" />
<PackageVersion Include="NetEscapades.AspNetCore.SecurityHeaders" Version="0.21.0" />
<PackageVersion Include="Mindscape.Raygun4Net.AspNetCore" Version="11.2.1" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17" />
<PackageVersion Include="NUnit" Version="4.3.2" />
<PackageVersion Include="NUnit.Analyzers" Version="4.6.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageVersion Include="NetEscapades.AspNetCore.SecurityHeaders" Version="0.24.0" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.4" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.24.0.89429">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="10.5.0.109200" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="7.2.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.3" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="EfCore.TestSupport" Version="8.0.1" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.17">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="NUnit.Analyzers" Version="4.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="NUnit" Version="4.1.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.0",
"version": "9.0.0",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
9 changes: 0 additions & 9 deletions src/AppServices/AppServices.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>AirWeb.AppServices</RootNamespace>
</PropertyGroup>

Expand All @@ -15,10 +11,6 @@
<PackageReference Include="GaEpd.FileService"/>
<PackageReference Include="JetBrains.Annotations"/>
<PackageReference Include="Microsoft.Identity.Web"/>
<PackageReference Include="SonarAnalyzer.CSharp">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand All @@ -30,5 +22,4 @@
<DependentUpon>WorkEntryService.cs</DependentUpon>
</Compile>
</ItemGroup>

</Project>
9 changes: 0 additions & 9 deletions src/Domain/Domain.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>AirWeb.Domain</RootNamespace>
</PropertyGroup>

Expand All @@ -12,10 +8,6 @@
<PackageReference Include="JetBrains.Annotations"/>
<PackageReference Include="Microsoft.EntityFrameworkCore"/>
<PackageReference Include="Microsoft.Extensions.Identity.Stores"/>
<PackageReference Include="SonarAnalyzer.CSharp">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand All @@ -30,5 +22,4 @@
<DependentUpon>AppRole.cs</DependentUpon>
</Compile>
</ItemGroup>

</Project>
9 changes: 0 additions & 9 deletions src/EfRepository/EfRepository.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>AirWeb.EfRepository</RootNamespace>
</PropertyGroup>

Expand All @@ -15,10 +11,6 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
<PackageReference Include="SonarAnalyzer.CSharp">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand All @@ -29,5 +21,4 @@
<ItemGroup>
<Folder Include="Migrations" />
</ItemGroup>

</Project>
9 changes: 0 additions & 9 deletions src/IaipDataService/IaipDataService.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>IaipDataService</RootNamespace>
</PropertyGroup>

Expand All @@ -13,10 +9,5 @@
<PackageReference Include="Microsoft.Data.SqlClient"/>
<PackageReference Include="Microsoft.Extensions.Caching.Memory"/>
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions"/>
<PackageReference Include="SonarAnalyzer.CSharp">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

</Project>
9 changes: 0 additions & 9 deletions src/LocalRepository/LocalRepository.csproj
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>AirWeb.LocalRepository</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GaEpd.EmailService"/>
<PackageReference Include="SonarAnalyzer.CSharp">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Domain\Domain.csproj"/>
<ProjectReference Include="..\TestData\TestData.csproj" />
</ItemGroup>

</Project>
12 changes: 0 additions & 12 deletions src/TestData/TestData.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>AirWeb.TestData</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SonarAnalyzer.CSharp">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Domain\Domain.csproj" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/WebApp/Platform/AppConfiguration/AppUrlRedirects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace AirWeb.WebApp.Platform.AppConfiguration;

// URL Rewriting Middleware in ASP.NET Core
// https://learn.microsoft.com/en-us/aspnet/core/fundamentals/url-rewriting?view=aspnetcore-8.0#performance-tips-for-url-rewrite-and-redirect
// https://learn.microsoft.com/en-us/aspnet/core/fundamentals/url-rewriting#performance-tips-for-url-rewrite-and-redirect
public static class AppUrlRedirects
{
// language=regex
Expand Down
9 changes: 0 additions & 9 deletions src/WebApp/WebApp.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<InformationalVersion>2024.8.27</InformationalVersion>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>AirWeb.WebApp</RootNamespace>
</PropertyGroup>

Expand All @@ -15,10 +11,6 @@
<PackageReference Include="Microsoft.Web.LibraryManager.Build" />
<PackageReference Include="Mindscape.Raygun4Net.AspNetCore" />
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" />
<PackageReference Include="SonarAnalyzer.CSharp">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Swashbuckle.AspNetCore" />
</ItemGroup>

Expand Down Expand Up @@ -60,5 +52,4 @@
<AbsolutePath>web.config</AbsolutePath>
</MsDeploySkipRules>
</ItemGroup>

</Project>
Loading
Loading