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

NOX-915 - [Nox.Lib] Update to .Net 8.0 #1493

Merged
merged 9 commits into from
Jun 4, 2024
Merged
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
7 changes: 0 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,3 @@ updates:
ignore:
- dependency-name: "*"
update-types: ["version-update:semver-major"]
- dependency-name: "MediatR" #until upgrade to .Net 8
- dependency-name: "Microsoft.Build.Framework" #until upgrade to .Net
- dependency-name: "Microsoft.CodeAnalysis.CSharp.Workspaces" #until upgrade to .Net 8 / Requires Latest VS, we do not want this
- dependency-name: "Microsoft.CodeAnalysis.CSharp" #until upgrade to .Net 8 / Requires Latest VS, we do not want this
- dependency-name: "Microsoft.CSharp" #until upgrade to .Net 8 / Requires Latest VS, we do not want this
- dependency-name: "Serilog*" #until upgrade to .Net 8
- dependency-name: "Microsoft.OData.Core" #dependabot is crashing when updating this package
4 changes: 2 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ['7.0.x']
dotnet-version: ['8.0.x']
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:

- name: Restore
run: dotnet restore Nox.sln

- name: Build
run: |
dotnet build ./src/Nox.Generator.Tasks --no-restore
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ['7.x']
dotnet-version: ['8.x']

steps:
- uses: actions/checkout@v3
Expand All @@ -33,7 +33,7 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
distribution: 'zulu'

- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
Expand Down
1 change: 1 addition & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mode: ContinuousDelivery
next-version: 8.0.0
branches: {}
ignore:
sha: []
Expand Down
8 changes: 4 additions & 4 deletions Nox.sln
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cryptocash.Application.Dto"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cryptocash.Application", "samples\Cryptocash.Application\Cryptocash.Application.csproj", "{3F8679EF-6686-420C-A4BB-413CAD92F5D5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cryptocash.Domain", "samples\Cryptocash.Domain\Cryptocash.Domain.csproj", "{E638A24C-A523-4295-80E4-6C3AFA0A0B92}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cryptocash.Domain", "samples\Cryptocash.Domain\Cryptocash.Domain.csproj", "{E638A24C-A523-4295-80E4-6C3AFA0A0B92}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cryptocash.Infrastructure", "samples\Cryptocash.Infrastructure\Cryptocash.Infrastructure.csproj", "{7786EDDE-5FD3-4714-B758-18EDC57DF7ED}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cryptocash.Infrastructure", "samples\Cryptocash.Infrastructure\Cryptocash.Infrastructure.csproj", "{7786EDDE-5FD3-4714-B758-18EDC57DF7ED}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -247,8 +247,8 @@ Global
{470CA4DC-B1A1-4DAE-9A70-FEEE9C0FD173}.Release|Any CPU.ActiveCfg = Release|Any CPU
{470CA4DC-B1A1-4DAE-9A70-FEEE9C0FD173}.Release|Any CPU.Build.0 = Release|Any CPU
{3CC4CBD7-2946-4171-BA1D-116955286B41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3CC4CBD7-2946-4171-BA1D-116955286B41}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3CC4CBD7-2946-4171-BA1D-116955286B41}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3CC4CBD7-2946-4171-BA1D-116955286B41}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D47CA1F-E1A4-419E-AFB1-19D96203F000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D47CA1F-E1A4-419E-AFB1-19D96203F000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D47CA1F-E1A4-419E-AFB1-19D96203F000}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -258,8 +258,8 @@ Global
{951B59F3-9C0B-4351-A745-08AE047898A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{951B59F3-9C0B-4351-A745-08AE047898A1}.Release|Any CPU.Build.0 = Release|Any CPU
{0105DEB7-C707-4AF2-807A-9478E3A4D2FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0105DEB7-C707-4AF2-807A-9478E3A4D2FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0105DEB7-C707-4AF2-807A-9478E3A4D2FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0105DEB7-C707-4AF2-807A-9478E3A4D2FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D664756-BD08-4692-9FD3-704505E3CA5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D664756-BD08-4692-9FD3-704505E3CA5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D664756-BD08-4692-9FD3-704505E3CA5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
14 changes: 7 additions & 7 deletions samples/Cryptocash.Api.Tests/Cryptocash.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand All @@ -13,16 +13,16 @@
<PackageReference Include="AutoFixture.AutoMoq" Version="4.18.1" />
<PackageReference Include="AutoFixture.Xunit2" Version="4.18.1" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="JsonSchema.Net.Generation" Version="4.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="JsonSchema.Net.Generation" Version="4.3.0.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Build.Framework" Version="17.7.2" />
<PackageReference Include="Microsoft.Build.Framework" Version="17.10.4" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ namespace Cryptocash.Tests;

public class CryptocashCountryDtoDataCreationTests
{
private static readonly JsonSerializerOptions JsonOptions = CreateJsonSerializerOptions();

#nullable enable

/// <summary>
/// Test used to create one-off CountryDto JSON data from Reference Data - to use make sure source json files are available otherwise test just returns empty string - use returning rtnJson value from Convert_Country_ReferenceData_to_DtoDataAsync to create the CryptocashCountry.Json file manually
/// </summary>
[Fact(Skip = "Only used as one-off to create DataSeeder Country JSON file")]
public async void Create_CountryDto_data_from_CountryReferenceData()
public async Task Create_CountryDto_data_from_CountryReferenceData()
{
var rootPath = "../../../../.nox";

Expand Down Expand Up @@ -118,13 +120,7 @@ private static async Task<string> Convert_Country_ReferenceData_to_DtoDataAsync(
}
}

var jsonOptions = new JsonSerializerOptions()
{
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault
};
jsonOptions.Converters.Add(new JsonStringEnumConverter());

string rtnJson = System.Text.Json.JsonSerializer.Serialize(CreatedData, jsonOptions);
string rtnJson = System.Text.Json.JsonSerializer.Serialize(CreatedData, JsonOptions);

return rtnJson;
}
Expand Down Expand Up @@ -542,4 +538,16 @@ private static List<CurrencyReferenceData> CreateValidatedCurrencyList(List<Curr

return new();
}

private static JsonSerializerOptions CreateJsonSerializerOptions()
{
var jsonOptions = new JsonSerializerOptions()
{
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault
};

jsonOptions.Converters.Add(new JsonStringEnumConverter());

return jsonOptions;
}
}
14 changes: 9 additions & 5 deletions samples/Cryptocash.Api/Cryptocash.Api.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<UsingTask TaskName="Nox.Generator.Tasks.NoxGeneratorTask" AssemblyFile="..\..\src\Nox.Generator.Tasks\bin\Debug\netstandard2.0\Nox.Generator.Tasks.dll" />
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
Expand Down Expand Up @@ -36,14 +36,18 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.14" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Rewrite" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.14">
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.9.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.9.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.14" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.6" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion samples/Cryptocash.Domain/Cryptocash.Domain.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
Expand Down
8 changes: 6 additions & 2 deletions samples/Cryptocash.Integration/Cryptocash.Integration.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
Expand Down Expand Up @@ -43,7 +43,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.14">
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.9.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.9.2" />
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.9.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
12 changes: 6 additions & 6 deletions samples/Cryptocash.Ui/Cryptocash.Ui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<UsingTask TaskName="Nox.Generator.Tasks.NoxGeneratorTask" AssemblyFile="..\..\src\Nox.Generator.Tasks\bin\Debug\netstandard2.0\Nox.Generator.Tasks.dll" />

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>435ebf39-2d2b-4f80-b323-7853bbd643ce</UserSecretsId>
Expand All @@ -13,11 +13,11 @@

<ItemGroup>
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.14" NoWarn="NU1605" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="7.0.14" NoWarn="NU1605" />
<PackageReference Include="Microsoft.Identity.Web" Version="2.17.0" />
<PackageReference Include="Microsoft.Identity.Web.UI" Version="2.17.0" />
<PackageReference Include="MudBlazor" Version="6.11.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.6" NoWarn="NU1605" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.6" NoWarn="NU1605" />
<PackageReference Include="Microsoft.Identity.Web" Version="2.19.0" />
<PackageReference Include="Microsoft.Identity.Web.UI" Version="2.19.0" />
<PackageReference Include="MudBlazor" Version="6.20.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Runtime.Serialization;

namespace Nox.Exceptions;

[Serializable]
public class EntityLocalizationNotFoundException : Exception, IApplicationException
{
public EntityLocalizationNotFoundException(string entityName, string entityId, string cultureCode)
Expand All @@ -24,10 +22,6 @@ public EntityLocalizationNotFoundException(string message, Exception inner)
{
ErrorDetails = message;
}
protected EntityLocalizationNotFoundException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}

public virtual HttpStatusCode? StatusCode => HttpStatusCode.NotFound;

Expand Down
6 changes: 1 addition & 5 deletions src/Nox.Core/Exceptions/EntityNotFoundException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

namespace Nox.Exceptions;

[Serializable]
public class EntityNotFoundException : Exception, IApplicationException
{
public EntityNotFoundException(string entityName, string entityId)
Expand All @@ -25,10 +24,7 @@ public EntityNotFoundException(string message, Exception inner)
{
ErrorDetails = message;
}
protected EntityNotFoundException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}

public virtual HttpStatusCode? StatusCode => HttpStatusCode.NotFound;

public virtual string ErrorCode => "entity_not_found";
Expand Down
7 changes: 1 addition & 6 deletions src/Nox.Core/Exceptions/RelatedEntityNotFoundException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Nox.Exceptions;

[Serializable]
public class RelatedEntityNotFoundException : EntityNotFoundException, IApplicationException
{
public RelatedEntityNotFoundException(string entityName, string entityId)
Expand All @@ -19,10 +18,6 @@ public RelatedEntityNotFoundException(string message, Exception inner)
: base(message, inner)
{
}
protected RelatedEntityNotFoundException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
public override string ErrorCode => "related_entity_not_found";

public override string ErrorCode => "related_entity_not_found";
}
6 changes: 0 additions & 6 deletions src/Nox.Core/Exceptions/RelationshipDeletionException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

namespace Nox.Exceptions;

[Serializable]
public class RelationshipDeletionException : Exception, IApplicationException
{
public RelationshipDeletionException(string message)
Expand All @@ -16,11 +15,6 @@ public RelationshipDeletionException(string message, Exception inner)
{
}

protected RelationshipDeletionException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}

public HttpStatusCode? StatusCode => HttpStatusCode.BadRequest;

public string ErrorCode => "can_not_delete_relationship";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
namespace Nox.Infrastructure.Persistence;

[Serializable]
public class TypeNotFoundException : Exception
{
public TypeNotFoundException(string typeName)
: base($"Could not resolve type for {typeName}.")
{

}

protected TypeNotFoundException(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context)
: base(info, context)
{
}
}
Loading
Loading