ソースを参照

Update:touchsocket version to 3.1.0 (#9864)

若汝棋茗 4 ヶ月 前
コミット
4648d5ecad

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

@@ -12,6 +12,6 @@
 	</PropertyGroup>
 
 	<ItemGroup>
-		<PackageReference Include="TouchSocket.Http" Version="3.0.24" />
+		<PackageReference Include="TouchSocket.Http" Version="3.1.0" />
 	</ItemGroup>
 </Project>

+ 3 - 3
frameworks/CSharp/touchsocket/src/TouchSocketWebApi/Program.cs

@@ -58,9 +58,9 @@ public class Program
     }
 }
 
-public partial class ApiServer : RpcServer
+public partial class ApiServer : SingletonRpcServer
 {
-    private HttpContent m_contentPlaintext = new StringHttpContent("Hello, World!", Encoding.UTF8, $"text/plain");
+    private readonly HttpContent m_contentPlaintext = new StringHttpContent("Hello, World!", Encoding.UTF8, $"text/plain");
    
     public static MyJson MyJson { get; set; } = new MyJson() { Message = "Hello, World!" };
 
@@ -71,7 +71,7 @@ public partial class ApiServer : RpcServer
        var response= callContext.HttpContext.Response;
         response.SetStatus(200, "success");
         response.Content= m_contentPlaintext;
-        await response.AnswerAsync();
+        await response.AnswerAsync().ConfigureAwait(false);
     }
 
     [Router("/json")]

+ 3 - 3
frameworks/CSharp/touchsocket/src/TouchSocketWebApi/TouchSocketWebApi.csproj

@@ -12,8 +12,8 @@
 
 	<ItemGroup>
 		<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
-		<PackageReference Include="TouchSocket.Hosting" Version="3.0.24" />
-		<PackageReference Include="TouchSocket.WebApi" Version="3.0.24" />
-		<PackageReference Include="TouchSocket.WebApi.Swagger" Version="3.0.24" />
+		<PackageReference Include="TouchSocket.Hosting" Version="3.1.0" />
+		<PackageReference Include="TouchSocket.WebApi" Version="3.1.0" />
+		<PackageReference Include="TouchSocket.WebApi.Swagger" Version="3.1.0" />
 	</ItemGroup>
 </Project>