Bläddra i källkod

Refact(touchsocket): Upgrade framework and dependent versions (#10171)

* 重构(project): 升级框架和依赖版本

升级目标框架至 net9.0,更新 TouchSocket 和 Hosting 相关依赖版本
调整 Program.cs 中变量声明为隐式类型,优化 Web API 配置方式
移除调试模式下的 Swagger 和浏览器启动功能
更新 Dockerfile 基础镜像至 .NET 9.0

* New (Project Configuration): Add TouchSocketHttp31 and TouchSocketWebAni31
Add TouchSocketHttp31 and TouchSocketWebAni31 projects to the solution
-Update Benchmarks.sln to support new projects and upgrade VS version to 18
-Add new configuration items to benchmark∝json and config. toml
-Add Dockerfiles for TouchSocketHttp31 and TouchSocketWebApp i31
-TouchSocketHttp project adds HTTP service program, supporting/plaintext and/json routing
-TouchSocketWebApi project adds Web API service program, supporting/plaintext and/json routing
-Add the configuration files' appsets.json 'and' appsettings. Development. json '
-The target frameworks for TouchSocketHttp31 and TouchSocketWebApp i31 projects are NET 8.0
-Add NuGet. Config to specify the unique package source as the official source of VNet

* fix(touchsocket):build error

* fix(touchsocket):build error x2

* update(touchsocket):nuget version to 4.0.0-beta.120
若汝棋茗 1 vecka sedan
förälder
incheckning
7953522f80

+ 14 - 2
frameworks/CSharp/touchsocket/Benchmarks.sln

@@ -1,12 +1,16 @@
 
 Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.0.31717.71
+# Visual Studio Version 18
+VisualStudioVersion = 18.0.11109.219 d18.0-oob
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TouchSocketWebApi", "src\TouchSocketWebApi\TouchSocketWebApi.csproj", "{6BD9363A-D77F-5D90-8444-2BC37495C920}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TouchSocketHttp", "src\TouchSocketHttp\TouchSocketHttp.csproj", "{A7FB43AB-672B-8854-68D7-C2B383B0BC04}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TouchSocketHttp31", "src\TouchSocketHttp31\TouchSocketHttp31.csproj", "{DE261A06-A254-FD54-4ACF-EE4D4352BA77}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TouchSocketWebApi31", "src\TouchSocketWebApi31\TouchSocketWebApi31.csproj", "{6B6A57CE-1F69-FA6E-7458-0A4B6AB60683}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -21,6 +25,14 @@ Global
 		{A7FB43AB-672B-8854-68D7-C2B383B0BC04}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{A7FB43AB-672B-8854-68D7-C2B383B0BC04}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{A7FB43AB-672B-8854-68D7-C2B383B0BC04}.Release|Any CPU.Build.0 = Release|Any CPU
+		{DE261A06-A254-FD54-4ACF-EE4D4352BA77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{DE261A06-A254-FD54-4ACF-EE4D4352BA77}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{DE261A06-A254-FD54-4ACF-EE4D4352BA77}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{DE261A06-A254-FD54-4ACF-EE4D4352BA77}.Release|Any CPU.Build.0 = Release|Any CPU
+		{6B6A57CE-1F69-FA6E-7458-0A4B6AB60683}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{6B6A57CE-1F69-FA6E-7458-0A4B6AB60683}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{6B6A57CE-1F69-FA6E-7458-0A4B6AB60683}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{6B6A57CE-1F69-FA6E-7458-0A4B6AB60683}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 40 - 1
frameworks/CSharp/touchsocket/benchmark_config.json

@@ -8,6 +8,7 @@
         "port": 8080,
         "approach": "Realistic",
         "classification": "Fullstack",
+        "database": "Postgres",
         "framework": "touchsocket.webapi",
         "language": "C#",
         "orm": "Raw",
@@ -38,7 +39,45 @@
         "display_name": "touchsocket.http",
         "notes": "",
         "versus": "aspnetcore"
+      },
+      "http31": {
+        "plaintext_url": "/plaintext",
+        "json_url": "/json",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Micro",
+        "database": "Postgres",
+        "framework": "touchsocket.http31",
+        "language": "C#",
+        "orm": "Micro",
+        "platform": ".NET",
+        "flavor": "CoreCLR",
+        "webserver": "touchsocket",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "touchsocket.http31",
+        "notes": "",
+        "versus": "aspnetcore"
+      },
+      "webapi31": {
+        "plaintext_url": "/plaintext",
+        "json_url": "/json",
+        "port": 8080,
+        "approach": "Realistic",
+        "classification": "Fullstack",
+        "database": "Postgres",
+        "framework": "touchsocket.webapi31",
+        "language": "C#",
+        "orm": "Raw",
+        "platform": ".NET",
+        "flavor": "CoreCLR",
+        "webserver": "touchsocket",
+        "os": "Linux",
+        "database_os": "Linux",
+        "display_name": "touchsocket.webapi31",
+        "notes": "",
+        "versus": "aspnetcore-mvc"
       }
     }
   ]
-}
+}

+ 26 - 0
frameworks/CSharp/touchsocket/config.toml

@@ -26,3 +26,29 @@ orm = "Raw"
 platform = ".NET"
 webserver = "touchsocket.http"
 versus = "aspcore"
+
+[http31]
+urls.plaintext = "/plaintext"
+urls.json = "/json"
+approach = "Realistic"
+classification = "Micro"
+database = "Postgres"
+database_os = "Linux"
+os = "Linux"
+orm = "Raw"
+platform = ".NET"
+webserver = "touchsocket.http31"
+versus = "aspcore"
+
+[webapi31]
+urls.plaintext = "/plaintext"
+urls.json = "/json"
+approach = "Realistic"
+classification = "Fullstack"
+database = "Postgres"
+database_os = "Linux"
+os = "Linux"
+orm = "Raw"
+platform = ".NET"
+webserver = "touchsocket.webapi31"
+versus = "aspcore-mvc"

+ 4 - 5
frameworks/CSharp/touchsocket/src/TouchSocketHttp/Program.cs

@@ -10,8 +10,8 @@ public class Program
 {
     private static async Task Main(string[] args)
     {
-        int port = 8080;
-        MyHttpService service = new MyHttpService();
+        var port = 8080;
+        var service = new MyHttpService();
 
         await service.SetupAsync(new TouchSocketConfig()
              .SetListenIPHosts(port)
@@ -22,7 +22,6 @@ public class Program
                  options.SendPipeOptions = TransportOption.CreateSchedulerOptimizedPipeOptions();
              })
              .SetMaxCount(1000000)
-             .SetBacklog(1000)
              .ConfigureContainer(a =>
              {
                  a.AddConsoleLogger();
@@ -52,8 +51,8 @@ internal sealed class MyHttpSessionClient : HttpSessionClient
 
     protected override async Task OnReceivedHttpRequest(HttpContext httpContext)
     {
-        HttpRequest request = httpContext.Request;
-        HttpResponse response = httpContext.Response;
+        var request = httpContext.Request;
+        var response = httpContext.Response;
 
         switch (request.RelativeURL)
         {

+ 6 - 6
frameworks/CSharp/touchsocket/src/TouchSocketHttp/TouchSocketHttp.csproj

@@ -1,17 +1,17 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk.Worker">
 
 	<PropertyGroup>
-		<TargetFramework>net8.0</TargetFramework>
+		<TargetFramework>net9.0</TargetFramework>
 		<Nullable>enable</Nullable>
 		<OutputType>Exe</OutputType>
 		<ImplicitUsings>enable</ImplicitUsings>
-		<InvariantGlobalization>true</InvariantGlobalization>
-		<!--<PublishAot>true</PublishAot>-->
 		<UserSecretsId>dotnet-TouchSocketWebApi-987c185f-10b1-452b-beb6-47d798a5a131</UserSecretsId>
-		<ServerGarbageCollection>true</ServerGarbageCollection>
 	</PropertyGroup>
 
 	<ItemGroup>
-		<PackageReference Include="TouchSocket.Http" Version="4.0.0-beta.80" />
+		<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
+		<PackageReference Include="TouchSocket.Hosting" Version="4.0.0-beta.120" />
+		<PackageReference Include="TouchSocket.WebApi" Version="4.0.0-beta.120" />
 	</ItemGroup>
 </Project>
+

+ 7 - 0
frameworks/CSharp/touchsocket/src/TouchSocketHttp31/NuGet.Config

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <packageSources>
+    <clear />
+    <add key="NuGet" value="https://api.nuget.org/v3/index.json" />
+  </packageSources>
+</configuration>

+ 99 - 0
frameworks/CSharp/touchsocket/src/TouchSocketHttp31/Program.cs

@@ -0,0 +1,99 @@
+using System.Text;
+using TouchSocket.Core;
+using TouchSocket.Http;
+using TouchSocket.Sockets;
+using static System.Net.Mime.MediaTypeNames;
+using HttpContent = TouchSocket.Http.HttpContent;
+
+namespace TouchSocketHttp;
+
+public class Program
+{
+    static async Task Main(string[] args)
+    {
+        int port = 8080;
+
+        Console.WriteLine(DateHelper.DateString);
+        var service = new MyHttpService();
+
+        await service.SetupAsync(new TouchSocketConfig()
+             .SetListenIPHosts(port)
+             .SetNoDelay(true)
+             .SetMaxCount(1000000)
+             .ConfigureContainer(a =>
+             {
+                 a.AddConsoleLogger();
+             }));
+
+        await service.StartAsync();
+        service.Logger.Info($"server is started,port:{port}");
+        while (true)
+        {
+            Console.ReadLine();
+        }
+    }
+}
+
+sealed class MyHttpService : HttpService<MyHttpSessionClient>
+{
+    protected override MyHttpSessionClient NewClient()
+    {
+        return new MyHttpSessionClient();
+    }
+}
+
+sealed class MyHttpSessionClient : HttpSessionClient
+{
+    private readonly HttpContent m_contentPlaintext = new StringHttpContent("Hello, World!", Encoding.UTF8, $"text/plain");
+    private readonly HttpContent m_contentJson = new StringHttpContent("{\"message\":\"Hello, World!\"}", Encoding.UTF8, $"application/json");
+
+    protected override async Task OnReceivedHttpRequest(HttpContext httpContext)
+    {
+        var request = httpContext.Request;
+        var response = httpContext.Response;
+
+        switch (request.RelativeURL)
+        {
+            case "/plaintext":
+                {
+                    response.StatusCode = 200;
+                    response.StatusMessage = "success";
+                    response.Headers.Add(HttpHeaders.Server, "T");
+                    response.Headers.Add(HttpHeaders.Date, DateHelper.DateString);
+                    response.Content = m_contentPlaintext;
+                    await response.AnswerAsync().ConfigureAwait(false);
+                }
+                break;
+            case "/json":
+                {
+                    response.StatusCode = 200;
+                    response.StatusMessage = "success";
+                    response.Headers.Add(HttpHeaders.Server, "T");
+                    response.Headers.Add(HttpHeaders.Date, DateHelper.DateString);
+                    response.Content = m_contentJson;
+                    await response.AnswerAsync().ConfigureAwait(false);
+                }
+                break;
+            default:
+                response.SetStatus(404, "not find");
+                await response.AnswerAsync().ConfigureAwait(false);
+                break;
+        }
+    }
+}
+
+static class DateHelper
+{
+    static Timer m_timer;
+    static DateHelper()
+    {
+        DateString = DateTime.UtcNow.ToGMTString();
+        m_timer = new Timer((state) =>
+            {
+                DateString = DateTime.UtcNow.ToGMTString();
+            }, null, 0, 1000);
+    }
+
+    public static string DateString { get; private set; }
+}
+

+ 17 - 0
frameworks/CSharp/touchsocket/src/TouchSocketHttp31/TouchSocketHttp31.csproj

@@ -0,0 +1,17 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+	<PropertyGroup>
+		<TargetFramework>net8.0</TargetFramework>
+		<Nullable>enable</Nullable>
+		<OutputType>Exe</OutputType>
+		<ImplicitUsings>enable</ImplicitUsings>
+		<InvariantGlobalization>true</InvariantGlobalization>
+		<!--<PublishAot>true</PublishAot>-->
+		<UserSecretsId>dotnet-TouchSocketWebApi-987c185f-10b1-455b-beb6-47d798a5a131</UserSecretsId>
+		<ServerGarbageCollection>true</ServerGarbageCollection>
+	</PropertyGroup>
+
+	<ItemGroup>
+		<PackageReference Include="TouchSocket.Http" Version="3.1.0" />
+	</ItemGroup>
+</Project>

+ 10 - 16
frameworks/CSharp/touchsocket/src/TouchSocketWebApi/Program.cs

@@ -25,7 +25,6 @@ public class Program
                  options.SendPipeOptions = TransportOption.CreateSchedulerOptimizedPipeOptions();
              })
             .SetMaxCount(1000000)
-            .SetBacklog(1000)
            .ConfigureContainer(a =>
            {
                a.AddConsoleLogger();
@@ -36,28 +35,23 @@ public class Program
            })
            .ConfigurePlugins(a =>
            {
-               a.UseTcpSessionCheckClear();
-
-               a.UseWebApi()
-               .ConfigureConverter(converter =>
+               a.UseWebApi(options =>
                {
-                   converter.Clear();
-                   converter.AddSystemTextJsonSerializerFormatter(options =>
+                   options.ConfigureConverter(converter =>
                    {
-                       options.TypeInfoResolverChain.Insert(0, AppJsonSerializerContext.Default);
+                       converter.Clear();
+                       converter.AddSystemTextJsonSerializerFormatter(jsonOptions =>
+                       {
+                           jsonOptions.TypeInfoResolverChain.Insert(0, AppJsonSerializerContext.Default);
+                       });
                    });
                });
 
-#if DEBUG
-               a.UseSwagger()
-               .UseLaunchBrowser();
-#endif
-
                a.UseDefaultHttpServicePlugin();
            });
         });
 
-        IHost host = builder.Build();
+        var host = builder.Build();
         host.Run();
     }
 }
@@ -72,7 +66,7 @@ public partial class ApiServer : SingletonRpcServer
     [WebApi(Method = HttpMethodType.Get)]
     public async Task Plaintext(IWebApiCallContext callContext)
     {
-        HttpResponse response = callContext.HttpContext.Response;
+        var response = callContext.HttpContext.Response;
         response.SetStatus(200, "ok");
         response.Content = m_contentPlaintext;
         await response.AnswerAsync().ConfigureAwait(false);
@@ -86,7 +80,7 @@ public partial class ApiServer : SingletonRpcServer
     }
 }
 
-[JsonSerializable(typeof(MyJson))]//ʵ¼ÊÀàÐÍ1
+[JsonSerializable(typeof(MyJson))]
 internal partial class AppJsonSerializerContext : JsonSerializerContext
 {
 

+ 5 - 9
frameworks/CSharp/touchsocket/src/TouchSocketWebApi/TouchSocketWebApi.csproj

@@ -1,19 +1,15 @@
 <Project Sdk="Microsoft.NET.Sdk.Worker">
 
 	<PropertyGroup>
-		<TargetFramework>net8.0</TargetFramework>
+		<TargetFramework>net9.0</TargetFramework>
 		<Nullable>enable</Nullable>
 		<ImplicitUsings>enable</ImplicitUsings>
-		<InvariantGlobalization>true</InvariantGlobalization>
-		<!--<PublishAot>true</PublishAot>-->
-		<UserSecretsId>dotnet-TouchSocketWebApi-987c185f-10b1-452b-beb6-47d798a5a131</UserSecretsId>
-		<ServerGarbageCollection>true</ServerGarbageCollection>
+		<UserSecretsId>dotnet-WorkerService1-19b37b17-6043-4334-ad9a-9e0e3c670da3</UserSecretsId>
 	</PropertyGroup>
 
 	<ItemGroup>
-		<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
-		<PackageReference Include="TouchSocket.Hosting" Version="4.0.0-beta.80" />
-		<PackageReference Include="TouchSocket.WebApi" Version="4.0.0-beta.80" />
-		<PackageReference Include="TouchSocket.WebApi.Swagger" Version="4.0.0-beta.80" />
+		<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
+		<PackageReference Include="TouchSocket.Hosting" Version="4.0.0-beta.120" />
+		<PackageReference Include="TouchSocket.WebApi" Version="4.0.0-beta.120" />
 	</ItemGroup>
 </Project>

+ 7 - 0
frameworks/CSharp/touchsocket/src/TouchSocketWebApi31/NuGet.Config

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+  <packageSources>
+    <clear />
+    <add key="NuGet" value="https://api.nuget.org/v3/index.json" />
+  </packageSources>
+</configuration>

+ 85 - 0
frameworks/CSharp/touchsocket/src/TouchSocketWebApi31/Program.cs

@@ -0,0 +1,85 @@
+using System.Text;
+using System.Text.Json.Serialization;
+using TouchSocket.Core;
+using TouchSocket.Http;
+using TouchSocket.Rpc;
+using TouchSocket.Sockets;
+using TouchSocket.WebApi;
+
+using HttpContent = TouchSocket.Http.HttpContent;
+
+namespace TouchSocketWebApi31;
+
+public class Program
+{
+    public static void Main(string[] args)
+    {
+        var builder = Host.CreateApplicationBuilder(args);
+
+        builder.Services.AddServiceHostedService<IHttpService, HttpService>(config =>
+        {
+            config.SetListenIPHosts(8080)
+            .SetNoDelay(true)
+            .SetMaxCount(1000000)
+           .ConfigureContainer(a =>
+           {
+               a.AddConsoleLogger();
+               a.AddRpcStore(store =>
+               {
+                   store.RegisterServer<ApiServer>();
+               });
+           })
+           .ConfigurePlugins(a =>
+           {
+               a.UseWebApi()
+               .ConfigureConverter(converter =>
+               {
+                   converter.Clear();
+                   converter.AddSystemTextJsonSerializerFormatter(options =>
+                   {
+                       options.TypeInfoResolverChain.Insert(0, AppJsonSerializerContext.Default);
+                   });
+               });
+               a.UseDefaultHttpServicePlugin();
+           });
+        });
+
+        var host = builder.Build();
+        host.Run();
+    }
+}
+
+public partial class ApiServer : SingletonRpcServer
+{
+    private readonly HttpContent m_contentPlaintext = new StringHttpContent("Hello, World!", Encoding.UTF8, $"text/plain");
+   
+    public static MyJson MyJson { get; set; } = new MyJson() { Message = "Hello, World!" };
+
+    [Router("/plaintext")]
+    [WebApi(Method = HttpMethodType.Get)]
+    public async Task Plaintext(IWebApiCallContext callContext)
+    {
+       var response= callContext.HttpContext.Response;
+        response.SetStatus(200, "ok");
+        response.Content= m_contentPlaintext;
+        await response.AnswerAsync().ConfigureAwait(false);
+    }
+
+    [Router("/json")]
+    [WebApi(Method = HttpMethodType.Get)]
+    public MyJson Json()
+    {
+        return MyJson;
+    }
+}
+
+[JsonSerializable(typeof(MyJson))]
+internal partial class AppJsonSerializerContext : JsonSerializerContext
+{
+
+}
+
+public class MyJson
+{
+    public string? Message { get; set; }
+}

+ 18 - 0
frameworks/CSharp/touchsocket/src/TouchSocketWebApi31/TouchSocketWebApi31.csproj

@@ -0,0 +1,18 @@
+<Project Sdk="Microsoft.NET.Sdk.Worker">
+
+	<PropertyGroup>
+		<TargetFramework>net8.0</TargetFramework>
+		<Nullable>enable</Nullable>
+		<ImplicitUsings>enable</ImplicitUsings>
+		<InvariantGlobalization>true</InvariantGlobalization>
+		<!--<PublishAot>true</PublishAot>-->
+		<UserSecretsId>dotnet-TouchSocketWebApi-987c185f-10b1-452b-beb7-47d798a5a131</UserSecretsId>
+		<ServerGarbageCollection>true</ServerGarbageCollection>
+	</PropertyGroup>
+
+	<ItemGroup>
+		<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
+		<PackageReference Include="TouchSocket.Hosting" Version="3.1.0" />
+		<PackageReference Include="TouchSocket.WebApi" Version="3.1.0" />
+	</ItemGroup>
+</Project>

+ 8 - 0
frameworks/CSharp/touchsocket/src/TouchSocketWebApi31/appsettings.Development.json

@@ -0,0 +1,8 @@
+{
+  "Logging": {
+    "LogLevel": {
+      "Default": "Information",
+      "Microsoft.Hosting.Lifetime": "Information"
+    }
+  }
+}

+ 8 - 0
frameworks/CSharp/touchsocket/src/TouchSocketWebApi31/appsettings.json

@@ -0,0 +1,8 @@
+{
+  "Logging": {
+    "LogLevel": {
+      "Default": "Information",
+      "Microsoft.Hosting.Lifetime": "Information"
+    }
+  }
+}

+ 2 - 2
frameworks/CSharp/touchsocket/touchsocket-http.dockerfile

@@ -1,9 +1,9 @@
-FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
+FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
 WORKDIR /app
 COPY src/TouchSocketHttp .
 RUN dotnet publish -c Release -o out
 
-FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
+FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
 
 WORKDIR /app
 COPY --from=build /app/out ./

+ 13 - 0
frameworks/CSharp/touchsocket/touchsocket-http31.dockerfile

@@ -0,0 +1,13 @@
+FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
+WORKDIR /app
+COPY src/TouchSocketHttp31 .
+RUN dotnet publish -c Release -o out
+
+FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
+
+WORKDIR /app
+COPY --from=build /app/out ./
+
+EXPOSE 8080
+
+ENTRYPOINT ["dotnet", "TouchSocketHttp31.dll"]

+ 13 - 0
frameworks/CSharp/touchsocket/touchsocket-webapi31.dockerfile

@@ -0,0 +1,13 @@
+FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
+WORKDIR /app
+COPY src/TouchSocketWebApi31 .
+RUN dotnet publish -c Release -o out
+
+FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
+
+WORKDIR /app
+COPY --from=build /app/out ./
+
+EXPOSE 8080
+
+ENTRYPOINT ["dotnet", "TouchSocketWebApi31.dll"]

+ 2 - 2
frameworks/CSharp/touchsocket/touchsocket.dockerfile

@@ -1,9 +1,9 @@
-FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
+FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
 WORKDIR /app
 COPY src/TouchSocketWebApi .
 RUN dotnet publish -c Release -o out
 
-FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
+FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
 
 WORKDIR /app
 COPY --from=build /app/out ./