Skip to content

Commit ae5f947

Browse files
Merge pull request #108 from wisedev-code/feat/dotnet10_update
feat: update to .net10
2 parents 32cdeb6 + d02cd5d commit ae5f947

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+106
-959
lines changed

.github/workflows/build-and-publish-inferpage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup .NET
1616
uses: actions/setup-dotnet@v4
1717
with:
18-
dotnet-version: '8.0.x'
18+
dotnet-version: '10.0.x'
1919

2020
- name: Restore dependencies
2121
run: dotnet restore src/MaIN.InferPage
@@ -24,7 +24,7 @@ jobs:
2424
run: dotnet build src/MaIN.InferPage --configuration Release --no-restore
2525

2626
- name: Publish project
27-
run: dotnet publish src/MaIN.InferPage --configuration Release --output ./publish --no-build
27+
run: dotnet publish src/MaIN.InferPage --framework net10.0 --configuration Release --output ./publish --no-build
2828

2929
- name: Upload build artifacts
3030
uses: actions/upload-artifact@v4

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup .NET
1919
uses: actions/setup-dotnet@v3
2020
with:
21-
dotnet-version: '8.0.x' # Change to your project’s .NET version
21+
dotnet-version: '10.0.x' # Change to your project’s .NET version
2222

2323
- name: Restore dependencies
2424
run: dotnet restore

Examples/Examples.SimpleConsole/Examples.SimpleConsole.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<IsPackable>false</IsPackable>
88
<Nullable>enable</Nullable>

Examples/Examples/Chat/ChatWithTextToSpeechExample.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using MaIN.Core.Hub;
22
using MaIN.Domain.Entities;
33
using MaIN.Services.Services.TTSService;
4+
#pragma warning disable CS0618 // Type or member is obsolete
45

56
namespace Examples.Chat;
67

Examples/Examples/Examples.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<IsPackable>false</IsPackable>

MaIN.Core.IntegrationTests/ChatTests.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
using System.Text.Json;
2-
using MaIN.Core.Hub;
3-
using MaIN.Domain.Configuration;
1+
using MaIN.Core.Hub;
42
using MaIN.Domain.Entities;
5-
using Microsoft.AspNetCore.Mvc.Testing;
6-
using Microsoft.Extensions.Configuration;
73

84
namespace MaIN.Core.IntegrationTests;
95

106
public class ChatTests : IntegrationTestBase
117
{
12-
public ChatTests(WebApplicationFactory<Program> factory) : base(factory)
8+
public ChatTests() : base()
139
{
1410
}
1511

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,51 @@
11
using System.Net.Sockets;
22
using MaIN.Services;
3+
using Microsoft.AspNetCore.Builder;
34
using Microsoft.AspNetCore.Hosting;
4-
using Microsoft.AspNetCore.Mvc.Testing;
5+
using Microsoft.AspNetCore.Hosting.Server;
6+
using Microsoft.Extensions.Configuration;
57
using Microsoft.Extensions.DependencyInjection;
8+
using Microsoft.Extensions.Hosting;
69

710
namespace MaIN.Core.IntegrationTests;
811

9-
public class IntegrationTestBase : IClassFixture<WebApplicationFactory<Program>>
12+
public class IntegrationTestBase : IDisposable
1013
{
11-
protected readonly WebApplicationFactory<Program> _factory;
12-
protected readonly HttpClient _client;
14+
protected readonly IHost _host;
15+
protected readonly IServiceProvider _services;
1316

14-
public IntegrationTestBase(WebApplicationFactory<Program> factory)
17+
public IntegrationTestBase()
1518
{
16-
_factory = factory.WithWebHostBuilder(builder =>
17-
{
18-
builder.ConfigureServices((context, services) =>
19+
_host = CreateHost();
20+
_host.Start();
21+
22+
_services = _host.Services;
23+
}
24+
25+
private IHost CreateHost()
26+
{
27+
var hostBuilder = Host.CreateDefaultBuilder()
28+
.ConfigureWebHostDefaults(webBuilder =>
1929
{
20-
services.AddMaIN(context.Configuration);
21-
22-
var provider = services.BuildServiceProvider();
23-
provider.UseMaIN();
30+
webBuilder
31+
.UseUrls("http://localhost:0") // Random available port
32+
.ConfigureServices((context, services) =>
33+
{
34+
services.AddMaIN(context.Configuration);
35+
36+
var provider = services.BuildServiceProvider();
37+
provider.UseMaIN();
38+
});
2439
});
25-
});
26-
27-
_client = _factory.CreateClient();
40+
41+
return hostBuilder.Build();
2842
}
29-
43+
44+
protected T GetService<T>() where T : notnull
45+
{
46+
return _services.GetRequiredService<T>();
47+
}
48+
3049
protected static bool PingHost(string host, int port, int timeout)
3150
{
3251
try
@@ -50,4 +69,9 @@ protected static bool PingHost(string host, int port, int timeout)
5069
return false;
5170
}
5271
}
72+
73+
public void Dispose()
74+
{
75+
_host?.Dispose();
76+
}
5377
}

MaIN.Core.IntegrationTests/MaIN.Core.IntegrationTests.csproj

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFrameworks>net8.0;net10.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<IsPackable>false</IsPackable>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.14" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
11+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.22" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
1313
<PackageReference Include="Moq" Version="4.20.72" />
14-
<PackageReference Include="xunit" Version="2.5.3"/>
15-
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3"/>
14+
<PackageReference Include="xunit" Version="2.9.3" />
15+
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
16+
<PrivateAssets>all</PrivateAssets>
17+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18+
</PackageReference>
1619
</ItemGroup>
1720

1821
<ItemGroup>
@@ -21,7 +24,6 @@
2124

2225
<ItemGroup>
2326
<ProjectReference Include="..\src\MaIN.Core\MaIN.Core.csproj" />
24-
<ProjectReference Include="..\src\MaIN\MaIN.csproj" />
2527
</ItemGroup>
2628

2729
<ItemGroup>

MaIN.sln

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaIN", "src\MaIN\MaIN.csproj", "{7E8DD6E0-F9A8-4BD0-8733-49F0F2F4FCA0}"
4-
EndProject
53
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Main.Infrastructure", "src\MaIN.Infrastructure\MaIN.Infrastructure.csproj", "{84C09EF9-B9E3-4ACB-9BC3-DEFFC29D528F}"
64
EndProject
75
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaIN.Services", "src\MaIN.Services\MaIN.Services.csproj", "{35DBE637-EC89-40A7-B5F9-D005D554E8ED}"
86
EndProject
97
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaIN.Domain", "src\MaIN.Domain\MaIN.Domain.csproj", "{4DEF4AA6-DFD8-4626-B8BE-2F773B12FE0C}"
108
EndProject
11-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaIN.RAG.Demo", "src\MaIN.RAG.Demo\MaIN.RAG.Demo.csproj", "{2351B015-EA33-42F3-A844-CECABF140E9A}"
12-
EndProject
139
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MaIN.Core", "src\MaIN.Core\MaIN.Core.csproj", "{E3CFD135-0339-4539-A5FB-96CBE92A8EA7}"
1410
EndProject
1511
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{28851935-517F-438D-BF7C-02FEB1A37A68}"
@@ -32,10 +28,6 @@ Global
3228
Release|Any CPU = Release|Any CPU
3329
EndGlobalSection
3430
GlobalSection(ProjectConfigurationPlatforms) = postSolution
35-
{7E8DD6E0-F9A8-4BD0-8733-49F0F2F4FCA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
36-
{7E8DD6E0-F9A8-4BD0-8733-49F0F2F4FCA0}.Debug|Any CPU.Build.0 = Debug|Any CPU
37-
{7E8DD6E0-F9A8-4BD0-8733-49F0F2F4FCA0}.Release|Any CPU.ActiveCfg = Release|Any CPU
38-
{7E8DD6E0-F9A8-4BD0-8733-49F0F2F4FCA0}.Release|Any CPU.Build.0 = Release|Any CPU
3931
{84C09EF9-B9E3-4ACB-9BC3-DEFFC29D528F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4032
{84C09EF9-B9E3-4ACB-9BC3-DEFFC29D528F}.Debug|Any CPU.Build.0 = Debug|Any CPU
4133
{84C09EF9-B9E3-4ACB-9BC3-DEFFC29D528F}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -48,10 +40,6 @@ Global
4840
{4DEF4AA6-DFD8-4626-B8BE-2F773B12FE0C}.Debug|Any CPU.Build.0 = Debug|Any CPU
4941
{4DEF4AA6-DFD8-4626-B8BE-2F773B12FE0C}.Release|Any CPU.ActiveCfg = Release|Any CPU
5042
{4DEF4AA6-DFD8-4626-B8BE-2F773B12FE0C}.Release|Any CPU.Build.0 = Release|Any CPU
51-
{2351B015-EA33-42F3-A844-CECABF140E9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
52-
{2351B015-EA33-42F3-A844-CECABF140E9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
53-
{2351B015-EA33-42F3-A844-CECABF140E9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
54-
{2351B015-EA33-42F3-A844-CECABF140E9A}.Release|Any CPU.Build.0 = Release|Any CPU
5543
{E3CFD135-0339-4539-A5FB-96CBE92A8EA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5644
{E3CFD135-0339-4539-A5FB-96CBE92A8EA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
5745
{E3CFD135-0339-4539-A5FB-96CBE92A8EA7}.Release|Any CPU.ActiveCfg = Release|Any CPU

Releases/0.8.0.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 0.8.0 release
2+
3+
- Update libraries to .NET 10

0 commit comments

Comments
 (0)