Skip to content

Commit 256d975

Browse files
committed
Compatible with .NET 10
1 parent 5f2083f commit 256d975

File tree

10 files changed

+80
-101
lines changed

10 files changed

+80
-101
lines changed

Directory.Packages.props

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<Project>
22
<PropertyGroup>
3-
<MSExtensionsVersion>8.0.0</MSExtensionsVersion>
4-
<AspNetCoreVersion>2.3.0</AspNetCoreVersion>
53
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
64
</PropertyGroup>
75
<ItemGroup>
@@ -38,8 +36,6 @@
3836
<PackageVersion Include="EntityFrameworkCore.BootKit" Version="8.9.0" />
3937
<PackageVersion Include="Fluid.Core" Version="2.11.1" />
4038
<PackageVersion Include="Nanoid" Version="3.1.0" />
41-
<PackageVersion Include="Swashbuckle.AspNetCore" Version="8.1.2" />
42-
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="8.0.1" />
4339
<PackageVersion Include="Anthropic.SDK" Version="5.8.0" />
4440
<PackageVersion Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
4541
<PackageVersion Include="NAudio" Version="2.2.1" />
@@ -134,20 +130,36 @@
134130
<PackageVersion Include="BotSharp.Plugin.LLamaSharp" Version="$(BotSharpVersion)" />
135131
<PackageVersion Include="BotSharp.Plugin.ChatHub" Version="$(BotSharpVersion)" />
136132
</ItemGroup>
133+
<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
134+
<PackageVersion Include="Swashbuckle.AspNetCore" Version="10.0.1" />
135+
<PackageVersion Include="AspNet.Security.OAuth.GitHub" Version="10.0.0" />
136+
<PackageVersion Include="AspNet.Security.OAuth.Keycloak" Version="10.0.0" />
137+
<PackageVersion Include="AspNet.Security.OAuth.Weixin" Version="10.0.0" />
138+
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="10.0.0" />
139+
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.0" />
140+
<PackageVersion Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="10.0.0" />
141+
<PackageVersion Include="Microsoft.OpenApi" Version="3.0.1" />
142+
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="10.0.0" />
143+
</ItemGroup>
137144
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
138-
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.16" />
145+
<PackageVersion Include="Swashbuckle.AspNetCore" Version="8.1.4" />
139146
<PackageVersion Include="AspNet.Security.OAuth.GitHub" Version="8.3.0" />
140147
<PackageVersion Include="AspNet.Security.OAuth.Keycloak" Version="8.3.0" />
141148
<PackageVersion Include="AspNet.Security.OAuth.Weixin" Version="8.3.0" />
149+
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.16" />
142150
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.16" />
143151
<PackageVersion Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="8.0.16" />
152+
<PackageVersion Include="Microsoft.OpenApi" Version="2.3.10" />
153+
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="8.0.1" />
144154
</ItemGroup>
145155
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
146-
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="6.0.27" />
156+
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.9.0" />
147157
<PackageVersion Include="AspNet.Security.OAuth.GitHub" Version="6.0.15" />
148158
<PackageVersion Include="AspNet.Security.OAuth.Keycloak" Version="6.0.15" />
149159
<PackageVersion Include="AspNet.Security.OAuth.Weixin" Version="6.0.15" />
160+
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="6.0.27" />
150161
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.25" />
151162
<PackageVersion Include="Microsoft.AspNetCore.SpaServices.Extensions" Version="6.0.26" />
163+
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="6.0.5" />
152164
</ItemGroup>
153165
</Project>

src/Infrastructure/BotSharp.OpenAPI/BotSharp.OpenAPI.csproj

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,10 @@
2222
<PackagePath>\</PackagePath>
2323
</None>
2424
</ItemGroup>
25-
25+
2626
<ItemGroup>
2727
<PackageReference Include="Swashbuckle.AspNetCore" />
2828
<PackageReference Include="System.Security.Cryptography.Pkcs" />
29-
</ItemGroup>
30-
31-
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
32-
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" />
33-
<PackageReference Include="AspNet.Security.OAuth.GitHub" />
34-
<PackageReference Include="AspNet.Security.OAuth.Keycloak" />
35-
<PackageReference Include="AspNet.Security.OAuth.Weixin" />
36-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
37-
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" />
38-
</ItemGroup>
39-
40-
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
4129
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" />
4230
<PackageReference Include="AspNet.Security.OAuth.GitHub" />
4331
<PackageReference Include="AspNet.Security.OAuth.Keycloak" />
@@ -46,8 +34,8 @@
4634
<PackageReference Include="Microsoft.AspNetCore.SpaServices.Extensions" />
4735
</ItemGroup>
4836

49-
<ItemGroup>
50-
<ProjectReference Include="..\BotSharp.Core\BotSharp.Core.csproj" />
37+
<ItemGroup>
38+
<ProjectReference Include="..\BotSharp.Core\BotSharp.Core.csproj" />
5139
<ProjectReference Include="..\BotSharp.Logger\BotSharp.Logger.csproj" />
5240
</ItemGroup>
5341

src/Infrastructure/BotSharp.OpenAPI/BotSharpOpenApiExtensions.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using Microsoft.IdentityModel.Logging;
99
using Microsoft.IdentityModel.Tokens;
1010
using Microsoft.Net.Http.Headers;
11-
using Microsoft.OpenApi.Models;
1211
using Microsoft.IdentityModel.JsonWebTokens;
1312
using BotSharp.OpenAPI.BackgroundServices;
1413
using System.Text.Json.Serialization;
@@ -161,26 +160,6 @@ public static IServiceCollection AddBotSharpOpenAPI(this IServiceCollection serv
161160
services.AddSwaggerGen(
162161
c =>
163162
{
164-
c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme
165-
{
166-
In = ParameterLocation.Header,
167-
Description = "Please insert JWT with Bearer into field",
168-
Name = "Authorization",
169-
Type = SecuritySchemeType.ApiKey
170-
});
171-
c.AddSecurityRequirement(new OpenApiSecurityRequirement {
172-
{
173-
new OpenApiSecurityScheme
174-
{
175-
Reference = new OpenApiReference
176-
{
177-
Type = ReferenceType.SecurityScheme,
178-
Id = "Bearer"
179-
}
180-
},
181-
Array.Empty<string>()
182-
}
183-
});
184163
}
185164
);
186165

src/Plugins/BotSharp.Plugin.ExcelHandler/BotSharp.Plugin.ExcelHandler.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>$(TargetFramework)</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7+
<LangVersion>$(LangVersion)</LangVersion>
8+
<VersionPrefix>$(BotSharpVersion)</VersionPrefix>
79
</PropertyGroup>
810

911
<ItemGroup>

src/Plugins/BotSharp.Plugin.Twilio/Services/TwilioSessionManager.cs

Lines changed: 52 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -3,67 +3,66 @@
33
using StackExchange.Redis;
44
using Task = System.Threading.Tasks.Task;
55

6-
namespace BotSharp.Plugin.Twilio.Services
6+
namespace BotSharp.Plugin.Twilio.Services;
7+
8+
public class TwilioSessionManager : ITwilioSessionManager
79
{
8-
public class TwilioSessionManager : ITwilioSessionManager
9-
{
10-
private readonly ConnectionMultiplexer _redis;
10+
private readonly ConnectionMultiplexer _redis;
1111

12-
public TwilioSessionManager(ConnectionMultiplexer redis)
13-
{
14-
_redis = redis;
15-
}
12+
public TwilioSessionManager(ConnectionMultiplexer redis)
13+
{
14+
_redis = redis;
15+
}
1616

17-
public async Task<AssistantMessage> GetAssistantReplyAsync(string conversationId, int seqNum)
18-
{
19-
var db = _redis.GetDatabase();
20-
var key = $"{conversationId}:Assisist:{seqNum}";
21-
var jsonStr = await db.StringGetAsync(key);
22-
return jsonStr.IsNull ? null : JsonSerializer.Deserialize<AssistantMessage>(jsonStr);
23-
}
17+
public async Task<AssistantMessage> GetAssistantReplyAsync(string conversationId, int seqNum)
18+
{
19+
var db = _redis.GetDatabase();
20+
var key = $"{conversationId}:Assisist:{seqNum}";
21+
var jsonStr = await db.StringGetAsync(key);
22+
return jsonStr.IsNull ? null : JsonSerializer.Deserialize<AssistantMessage>(jsonStr.ToString());
23+
}
2424

25-
public async Task<List<string>> RetrieveStagedCallerMessagesAsync(string conversationId, int seqNum)
26-
{
27-
var db = _redis.GetDatabase();
28-
var key = $"{conversationId}:Caller:{seqNum}";
29-
return (await db.ListRangeAsync(key)).Select(x => (string)x).ToList();
30-
}
25+
public async Task<List<string>> RetrieveStagedCallerMessagesAsync(string conversationId, int seqNum)
26+
{
27+
var db = _redis.GetDatabase();
28+
var key = $"{conversationId}:Caller:{seqNum}";
29+
return (await db.ListRangeAsync(key)).Select(x => (string)x).ToList();
30+
}
3131

32-
public async Task SetAssistantReplyAsync(string conversationId, int seqNum, AssistantMessage message)
33-
{
34-
var jsonStr = JsonSerializer.Serialize(message);
35-
var db = _redis.GetDatabase();
36-
var key = $"{conversationId}:Assisist:{seqNum}";
37-
await db.StringSetAsync(key, jsonStr, TimeSpan.FromMinutes(5));
38-
}
32+
public async Task SetAssistantReplyAsync(string conversationId, int seqNum, AssistantMessage message)
33+
{
34+
var jsonStr = JsonSerializer.Serialize(message);
35+
var db = _redis.GetDatabase();
36+
var key = $"{conversationId}:Assisist:{seqNum}";
37+
await db.StringSetAsync(key, jsonStr, TimeSpan.FromMinutes(5));
38+
}
3939

40-
public async Task StageCallerMessageAsync(string conversationId, int seqNum, string message)
41-
{
42-
var db = _redis.GetDatabase();
43-
var key = $"{conversationId}:Caller:{seqNum}";
44-
await db.ListRightPushAsync(key, message);
45-
await db.KeyExpireAsync(key, DateTime.UtcNow.AddMinutes(10));
46-
}
40+
public async Task StageCallerMessageAsync(string conversationId, int seqNum, string message)
41+
{
42+
var db = _redis.GetDatabase();
43+
var key = $"{conversationId}:Caller:{seqNum}";
44+
await db.ListRightPushAsync(key, message);
45+
await db.KeyExpireAsync(key, DateTime.UtcNow.AddMinutes(10));
46+
}
4747

48-
public async Task SetReplyIndicationAsync(string conversationId, int seqNum, string indication)
49-
{
50-
var db = _redis.GetDatabase();
51-
var key = $"{conversationId}:Indication:{seqNum}";
52-
await db.StringSetAsync(key, indication, TimeSpan.FromMinutes(5));
53-
}
48+
public async Task SetReplyIndicationAsync(string conversationId, int seqNum, string indication)
49+
{
50+
var db = _redis.GetDatabase();
51+
var key = $"{conversationId}:Indication:{seqNum}";
52+
await db.StringSetAsync(key, indication, TimeSpan.FromMinutes(5));
53+
}
5454

55-
public async Task<string> GetReplyIndicationAsync(string conversationId, int seqNum)
56-
{
57-
var db = _redis.GetDatabase();
58-
var key = $"{conversationId}:Indication:{seqNum}";
59-
return await db.StringGetAsync(key);
60-
}
55+
public async Task<string> GetReplyIndicationAsync(string conversationId, int seqNum)
56+
{
57+
var db = _redis.GetDatabase();
58+
var key = $"{conversationId}:Indication:{seqNum}";
59+
return await db.StringGetAsync(key);
60+
}
6161

62-
public async Task RemoveReplyIndicationAsync(string conversationId, int seqNum)
63-
{
64-
var db = _redis.GetDatabase();
65-
var key = $"{conversationId}:Indication:{seqNum}";
66-
await db.KeyDeleteAsync(key);
67-
}
62+
public async Task RemoveReplyIndicationAsync(string conversationId, int seqNum)
63+
{
64+
var db = _redis.GetDatabase();
65+
var key = $"{conversationId}:Indication:{seqNum}";
66+
await db.KeyDeleteAsync(key);
6867
}
6968
}

src/WebStarter/WebStarter.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
<Copy SourceFiles="@(CoreContentFiles)" DestinationFolder="$(OutputPath)data\%(RecursiveDir)" />
3030
</Target>
3131
<ItemGroup>
32-
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" />
3332
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" />
3433
</ItemGroup>
3534

tests/BotSharp.LLM.Tests/BotSharp.LLM.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>$(TargetFramework)</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<IsPackable>false</IsPackable>

tests/BotSharp.Test.BrowserUse/BotSharp.Test.BrowserUse.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+
<TargetFramework>$(TargetFramework)</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>

tests/BotSharp.Test.ComputerUse/BotSharp.Test.ComputerUse.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+
<TargetFramework>$(TargetFramework)</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>

tests/BotSharp.Test.RealtimeVoice/BotSharp.Test.RealtimeVoice.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+
<TargetFramework>$(TargetFramework)</TargetFramework>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
<UserSecretsId>d7da3ed7-20a7-4acc-8018-ef9b705fea40</UserSecretsId>

0 commit comments

Comments
 (0)