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 #874

Open
wants to merge 3 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.complaint-tracking" /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]Cts.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]Cts.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]Cts.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]Cts.EfRepository.Migrations.*" --merge-with "coverage.json" -f=opencover -o="coverage.xml"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
2 changes: 1 addition & 1 deletion .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 Down
4 changes: 2 additions & 2 deletions .run/Watch WebApp.run.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<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" />
Expand Down
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
22 changes: 18 additions & 4 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>

<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>
38 changes: 18 additions & 20 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ItemGroup>
<PackageVersion Include="AutoMapper" Version="13.0.1" />
<PackageVersion Include="ClosedXML" Version="0.104.2" />
<PackageVersion Include="CsvHelper" Version="31.0.3" />
<PackageVersion Include="CsvHelper" Version="33.0.1" />
<PackageVersion Include="Dapper" Version="2.1.35" />
<PackageVersion Include="FluentValidation.AspNetCore" Version="11.3.0" />
<PackageVersion Include="GaEpd.AppLibrary" Version="5.4.0" />
Expand All @@ -15,46 +15,44 @@
<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.EntityFrameworkCore.Design" Version="8.0.4">
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.1">
<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.3" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="8.0.4" />
<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.17.5" />
<PackageVersion Include="Microsoft.Identity.Web" Version="3.5.0" />
<PackageVersion Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" />
<PackageVersion Include="Mindscape.Raygun4Net.AspNetCore" Version="11.2.1" />
<PackageVersion Include="NetEscapades.AspNetCore.SecurityHeaders" Version="0.21.0" />
<PackageVersion Include="NetEscapades.AspNetCore.SecurityHeaders" Version="0.24.0" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.6" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="10.4.0.108396">
<PackageVersion Include="SonarAnalyzer.CSharp" Version="10.5.0.109200">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Swashbuckle.AspNetCore" Version="7.2.0" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="coverlet.collector" Version="6.0.2">
<PackageVersion Include="coverlet.collector" Version="6.0.3">
<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="EfCore.TestSupport" Version="9.0.0" />
<PackageVersion Include="FluentAssertions" Version="[7.0.0,8.0)" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="NSubstitute" Version="5.3.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.1.0">
<PackageVersion Include="NUnit.Analyzers" Version="4.6.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" />
<PackageVersion Include="NUnit" Version="4.3.2" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
</ItemGroup>
</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
13 changes: 2 additions & 11 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>Cts.AppServices</RootNamespace>
</PropertyGroup>

Expand All @@ -12,19 +8,14 @@
<PackageReference Include="ClosedXML" />
<PackageReference Include="CsvHelper" />
<PackageReference Include="FluentValidation.AspNetCore" />
<PackageReference Include="GaEpd.EmailService"/>
<PackageReference Include="GaEpd.EmailService" />
<PackageReference Include="GaEpd.FileService" />
<PackageReference Include="Microsoft.EntityFrameworkCore" />
<PackageReference Include="Microsoft.Identity.Web"/>
<PackageReference Include="Microsoft.Identity.Web" />
<PackageReference Include="SixLabors.ImageSharp" />
<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>
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>Cts.Domain</RootNamespace>
</PropertyGroup>

Expand All @@ -12,10 +8,5 @@
<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>

</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>Cts.EfRepository</RootNamespace>
</PropertyGroup>

Expand All @@ -15,15 +11,10 @@
<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>
<ProjectReference Include="..\AppServices\AppServices.csproj" />
<ProjectReference Include="..\TestData\TestData.csproj" />
</ItemGroup>

</Project>
Loading
Loading