summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2023-10-12 14:49:24 -0400
committerGitHub <noreply@github.com>2023-10-12 14:49:24 -0400
commitfbc2d6fc5537f84269fa296ea85e6f462852e49b (patch)
tree46a8f8fd6e4ad26127da5e9a460488f014f1c9b3 /cpp/src
parentFix DLL's path generated by IceBox script (#1552) (diff)
downloadice-fbc2d6fc5537f84269fa296ea85e6f462852e49b.tar.bz2
ice-fbc2d6fc5537f84269fa296ea85e6f462852e49b.tar.xz
ice-fbc2d6fc5537f84269fa296ea85e6f462852e49b.zip
Suppress BinaryFormatter-related code for .NET 8.0 (#1550)
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/slice2cs/Gen.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp
index b4ff72c7e2c..4e3af355946 100644
--- a/cpp/src/slice2cs/Gen.cpp
+++ b/cpp/src/slice2cs/Gen.cpp
@@ -2973,6 +2973,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p)
if(!dataMembers.empty())
{
_out << sp;
+ _out << nl << "#if !NET8_0_OR_GREATER";
emitGeneratedCodeAttribute();
_out << nl << "public override void GetObjectData(global::System.Runtime.Serialization.SerializationInfo info, "
<< "global::System.Runtime.Serialization.StreamingContext context)";
@@ -2984,6 +2985,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p)
}
_out << sp << nl << "base.GetObjectData(info, context);";
_out << eb;
+ _out << nl << "#endif";
}
_out << sp << nl << "#endregion"; // Object members