From 77d9c3cbe9c7c0a510931e105a56511313aea23b Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Thu, 31 Aug 2023 15:26:06 +0200 Subject: [PATCH] Target net462 for gRPC WinHttpHandler support --- Directory.Packages.props | 6 +++--- Milvus.Client/Diagnostics/CompilerAttributes.cs | 2 +- Milvus.Client/Milvus.Client.csproj | 5 +++-- Milvus.Client/MilvusException.cs | 16 +++++++++++++++- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index c549f84..76ce8d8 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,9 +1,9 @@ - - - + + + diff --git a/Milvus.Client/Diagnostics/CompilerAttributes.cs b/Milvus.Client/Diagnostics/CompilerAttributes.cs index b6655c4..aca1155 100644 --- a/Milvus.Client/Diagnostics/CompilerAttributes.cs +++ b/Milvus.Client/Diagnostics/CompilerAttributes.cs @@ -6,7 +6,7 @@ namespace System.Runtime.CompilerServices; -#if NETSTANDARD2_0 +#if NETSTANDARD2_0 || NET462 using ComponentModel; diff --git a/Milvus.Client/Milvus.Client.csproj b/Milvus.Client/Milvus.Client.csproj index b31a3a2..1c6c3f1 100644 --- a/Milvus.Client/Milvus.Client.csproj +++ b/Milvus.Client/Milvus.Client.csproj @@ -1,7 +1,8 @@  - net6.0;netstandard2.0 + + net6.0;netstandard2.0;net462 net6.0 true All @@ -43,7 +44,7 @@ - + diff --git a/Milvus.Client/MilvusException.cs b/Milvus.Client/MilvusException.cs index b85f909..1bfd896 100644 --- a/Milvus.Client/MilvusException.cs +++ b/Milvus.Client/MilvusException.cs @@ -1,8 +1,15 @@ -namespace Milvus.Client; +#if NET462 +using System.Runtime.Serialization; +#endif + +namespace Milvus.Client; /// /// Exception thrown for errors related to the Milvus client. /// +#if NET462 +[Serializable] +#endif public sealed class MilvusException : Exception { /// @@ -33,4 +40,11 @@ public MilvusException(MilvusErrorCode errorCode, string reason) { ErrorCode = errorCode; } + +#if NET462 + private MilvusException(SerializationInfo info, StreamingContext context) + { + info.AddValue(nameof(ErrorCode), ErrorCode); + } +#endif }