Skip to content

Commit

Permalink
Upgrade to .NET 9x
Browse files Browse the repository at this point in the history
  • Loading branch information
VahidN committed Nov 15, 2024
1 parent 12887c8 commit f921f4c
Show file tree
Hide file tree
Showing 95 changed files with 1,390 additions and 1,680 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "8.0.8",
"version": "9.0.0",
"commands": [
"dotnet-ef"
]
Expand Down
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,30 @@ dotnet_diagnostic.CA5395.severity = suggestion

# CA1510: Use 'ArgumentNullException.ThrowIfNull' instead of explicitly throwing a new exception instance
dotnet_diagnostic.CA1510.severity = suggestion
dotnet_diagnostic.CA1515.severity = suggestion
dotnet_diagnostic.S4487.severity = suggestion
dotnet_diagnostic.S1144.severity = suggestion
dotnet_diagnostic.S6605.severity = suggestion

dotnet_diagnostic.IDE0005.severity = none
dotnet_diagnostic.IDE0055.severity = none
dotnet_diagnostic.IDE0160.severity = none
dotnet_diagnostic.IDE0022.severity = none
dotnet_diagnostic.IDE0021.severity = none
dotnet_diagnostic.IDE0008.severity = none
dotnet_diagnostic.IDE0061.severity = none
dotnet_diagnostic.IDE0023.severity = none
dotnet_diagnostic.IDE0051.severity = suggestion
dotnet_diagnostic.IDE0052.severity = suggestion
dotnet_diagnostic.IDE0058.severity = suggestion
dotnet_diagnostic.IDE0046.severity = suggestion
dotnet_diagnostic.IDE0048.severity = suggestion
dotnet_diagnostic.IDE0010.severity = suggestion
dotnet_diagnostic.IDE0045.severity = suggestion
dotnet_diagnostic.IDE0130.severity = suggestion
dotnet_diagnostic.IDE0072.severity = suggestion


# CA1852: Type can be sealed because it has no subtypes in its containing assembly and is not externally visible
dotnet_diagnostic.CA1852.severity = suggestion

Expand Down
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: nuget
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
groups:
tests:
patterns: ["*"]
update-types: ["minor", "patch"]
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Build DNTIdentity
run: dotnet build ./src/ASPNETCoreIdentitySample/ASPNETCoreIdentitySample.csproj --configuration Release
8 changes: 4 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
config-file: ./.github/workflows/codeql/codeql-config.yml
Expand All @@ -62,11 +62,11 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
# - name: Autobuild
# uses: github/codeql-action/autobuild@v2
# uses: github/codeql-action/autobuild@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Build
run: dotnet build --configuration Release

Expand All @@ -81,6 +81,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
8 changes: 4 additions & 4 deletions .template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"datatype": "choice",
"choices": [
{
"choice": "net8.0",
"description": "Target .NET 8"
"choice": "net9.0",
"description": "Target .NET 9"
}
],
"defaultValue": "net8.0",
"replaces": "net8.0"
"defaultValue": "net9.0",
"replaces": "net9.0"
}
}
}
186 changes: 98 additions & 88 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,96 +1,106 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<AnalysisLevel>latest</AnalysisLevel>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<RunAnalyzersDuringLiveAnalysis>true</RunAnalyzersDuringLiveAnalysis>
<!--
<PropertyGroup>
<LangVersion>latest</LangVersion>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
<AnalysisLevel>latest</AnalysisLevel>
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<ImplicitUsings>enable</ImplicitUsings>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
<RunAnalyzersDuringLiveAnalysis>true</RunAnalyzersDuringLiveAnalysis>
<!--
CA2007: Consider calling ConfigureAwait on the awaited task
MA0004: Use Task.ConfigureAwait(false) as the current SynchronizationContext is not needed
CA1056: Change the type of property 'Url' from 'string' to 'System.Uri'
CA1054: Change the type of parameter of the method to allow a Uri to be passed as a 'System.Uri' object
CA1055: Change the return type of method from 'string' to 'System.Uri'
-->
<NoWarn>$(NoWarn);CA2007;CA1056;CA1054;CA1055;MA0004;RCS1090</NoWarn>
<NoError>$(NoError);CA2007;CA1056;CA1054;CA1055;MA0004;RCS1090</NoError>
<Deterministic>true</Deterministic>
<Features>strict</Features>
<ReportAnalyzer>true</ReportAnalyzer>
</PropertyGroup>
<ItemGroup>
<Using Include="System.Globalization"/>
<Using Include="System.Text.Json"/>
<Using Include="System.FormattableString" Static="True"/>
<Using Include="System.Console" Static="True"/>
<Using Include="System.Security.Cryptography"/>
<Using Include="System.Diagnostics.CodeAnalysis"/>
<Using Include="System.Text.Json.Serialization"/>
<Using Include="System.Linq.Expressions"/>
<Using Include="System.Reflection"/>
<Using Include="System.ComponentModel.DataAnnotations"/>
<Using Include="System.Diagnostics"/>
<Using Include="System.ComponentModel.DataAnnotations.Schema"/>
<Using Include="System.Net"/>
<Using Include="System.Net.Http.Headers"/>
<Using Include="System.Net.Http.Json"/>
<Using Include="System.Text.Json"/>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<PackageReference Include="Meziantou.Analyzer">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="AsyncFixer">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Asyncify">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SonarAnalyzer.CSharp">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SecurityCodeScan.VS2019">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)BannedSymbols.txt" Link="Properties/BannedSymbols.txt"/>
<Compile Include="$(MSBuildThisFileDirectory)/common/AssemblyInfo.cs" Link="Properties/AssemblyInfo.common.cs"/>
</ItemGroup>
<NoWarn>$(NoWarn);CA2007;CA1056;CA1054;CA1055;MA0004;RCS1090</NoWarn>
<NoError>$(NoError);CA2007;CA1056;CA1054;CA1055;MA0004;RCS1090</NoError>
<Deterministic>true</Deterministic>
<Features>strict</Features>
<ReportAnalyzer>true</ReportAnalyzer>
</PropertyGroup>

<PropertyGroup>
<NuGetAudit>true</NuGetAudit>
<NuGetAuditMode>all</NuGetAuditMode>
<NuGetAuditLevel>low</NuGetAuditLevel>
<WarningsNotAsErrors Condition="'$(Configuration)' != 'Release'">
$(WarningsNotAsErrors);NU1900;NU1901;NU1902;NU1903;NU1904
</WarningsNotAsErrors>
</PropertyGroup>

<ItemGroup>
<Using Include="System.Globalization"/>
<Using Include="System.Text.Json"/>
<Using Include="System.FormattableString" Static="True"/>
<Using Include="System.Console" Static="True"/>
<Using Include="System.Security.Cryptography"/>
<Using Include="System.Diagnostics.CodeAnalysis"/>
<Using Include="System.Text.Json.Serialization"/>
<Using Include="System.Linq.Expressions"/>
<Using Include="System.Reflection"/>
<Using Include="System.ComponentModel.DataAnnotations"/>
<Using Include="System.Diagnostics"/>
<Using Include="System.ComponentModel.DataAnnotations.Schema"/>
<Using Include="System.Net"/>
<Using Include="System.Net.Http.Headers"/>
<Using Include="System.Net.Http.Json"/>
<Using Include="System.Text.Json"/>
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<PackageReference Include="Meziantou.Analyzer">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="AsyncFixer">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Asyncify">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SonarAnalyzer.CSharp">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="SecurityCodeScan.VS2019">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)BannedSymbols.txt" Link="Properties/BannedSymbols.txt"/>
<Compile Include="$(MSBuildThisFileDirectory)/common/AssemblyInfo.cs" Link="Properties/AssemblyInfo.common.cs"/>
</ItemGroup>
</Project>
76 changes: 38 additions & 38 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
<Project>
<ItemGroup>
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.163" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.11.20" />
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="AsyncFixer" Version="1.6.0" />
<PackageVersion Include="Asyncify" Version="0.9.7" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.32.0.97167" />
<PackageVersion Include="SecurityCodeScan.VS2019" Version="5.6.7" />
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Analyzers" Version="8.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.8" />
<PackageVersion Include="DNTBreadCrumb.Core" Version="2.0.2" />
<PackageVersion Include="DNTCaptcha.Core" Version="5.2.7" />
<PackageVersion Include="DNTCommon.Web.Core" Version="6.5.1" />
<PackageVersion Include="DNTPersianUtils.Core" Version="6.3.1" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.8" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.8" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="8.0.8" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="8.0.8" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.6.0" />
<PackageVersion Include="MSTest.TestFramework" Version="3.6.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.SqlServer" Version="8.0.8" />
<PackageVersion Include="cloudscribe.Web.Pagination" Version="8.0.0" />
<PackageVersion Include="LigerShark.WebOptimizer.Core" Version="3.0.426" />
<PackageVersion Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.179"/>
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.12.19"/>
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4"/>
<PackageVersion Include="AsyncFixer" Version="1.6.0"/>
<PackageVersion Include="Asyncify" Version="0.9.7"/>
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.32.0.97167"/>
<PackageVersion Include="SecurityCodeScan.VS2019" Version="5.6.7"/>
<PackageVersion Include="Roslynator.Analyzers" Version="4.12.9"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Analyzers" Version="9.0.0"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0"/>
<PackageVersion Include="DNTBreadCrumb.Core" Version="2.0.2"/>
<PackageVersion Include="DNTCaptcha.Core" Version="5.2.7"/>
<PackageVersion Include="DNTCommon.Web.Core" Version="7.6.2"/>
<PackageVersion Include="DNTPersianUtils.Core" Version="6.3.1"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="9.0.0"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="9.0.0"/>
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.0"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.0"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="9.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="9.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="9.0.0"/>
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="9.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="9.0.0"/>
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0"/>
<PackageVersion Include="Microsoft.Extensions.Options" Version="9.0.0"/>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1"/>
<PackageVersion Include="MSTest.TestAdapter" Version="3.6.3"/>
<PackageVersion Include="MSTest.TestFramework" Version="3.6.3"/>
<PackageVersion Include="Microsoft.Extensions.Caching.SqlServer" Version="9.0.0"/>
<PackageVersion Include="cloudscribe.Web.Pagination" Version="8.0.0"/>
<PackageVersion Include="LigerShark.WebOptimizer.Core" Version="3.0.433"/>
<PackageVersion Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175"/>
</ItemGroup>
</Project>
Loading

0 comments on commit f921f4c

Please sign in to comment.