diff --git a/ICSharpCode.AvalonEdit/Editing/DragDropException.cs b/ICSharpCode.AvalonEdit/Editing/DragDropException.cs
index c3417887..1b6d28bc 100644
--- a/ICSharpCode.AvalonEdit/Editing/DragDropException.cs
+++ b/ICSharpCode.AvalonEdit/Editing/DragDropException.cs
@@ -50,12 +50,13 @@ public DragDropException(string message) : base(message)
public DragDropException(string message, Exception innerException) : base(message, innerException)
{
}
-
+#if !NET6_0_OR_GREATER
///
/// Deserializes a DragDropException.
///
protected DragDropException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
+#endif
}
}
diff --git a/ICSharpCode.AvalonEdit/Highlighting/HighlightingDefinitionInvalidException.cs b/ICSharpCode.AvalonEdit/Highlighting/HighlightingDefinitionInvalidException.cs
index 2cb3679a..c05b3415 100644
--- a/ICSharpCode.AvalonEdit/Highlighting/HighlightingDefinitionInvalidException.cs
+++ b/ICSharpCode.AvalonEdit/Highlighting/HighlightingDefinitionInvalidException.cs
@@ -47,12 +47,13 @@ public HighlightingDefinitionInvalidException(string message) : base(message)
public HighlightingDefinitionInvalidException(string message, Exception innerException) : base(message, innerException)
{
}
-
+#if !NET6_0_OR_GREATER
///
/// Creates a new HighlightingDefinitionInvalidException instance.
///
protected HighlightingDefinitionInvalidException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
+#endif
}
}
diff --git a/ICSharpCode.AvalonEdit/Rendering/VisualLinesInvalidException.cs b/ICSharpCode.AvalonEdit/Rendering/VisualLinesInvalidException.cs
index 79b85cb8..add5db6b 100644
--- a/ICSharpCode.AvalonEdit/Rendering/VisualLinesInvalidException.cs
+++ b/ICSharpCode.AvalonEdit/Rendering/VisualLinesInvalidException.cs
@@ -48,12 +48,13 @@ public VisualLinesInvalidException(string message) : base(message)
public VisualLinesInvalidException(string message, Exception innerException) : base(message, innerException)
{
}
-
+#if !NET6_0_OR_GREATER
///
/// Creates a new VisualLinesInvalidException instance.
///
protected VisualLinesInvalidException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
+#endif
}
}
diff --git a/ICSharpCode.AvalonEdit/Search/ISearchStrategy.cs b/ICSharpCode.AvalonEdit/Search/ISearchStrategy.cs
index 74bea578..05f31fd5 100644
--- a/ICSharpCode.AvalonEdit/Search/ISearchStrategy.cs
+++ b/ICSharpCode.AvalonEdit/Search/ISearchStrategy.cs
@@ -93,11 +93,12 @@ public SearchPatternException(string message) : base(message)
public SearchPatternException(string message, Exception innerException) : base(message, innerException)
{
}
-
+#if !NET6_0_OR_GREATER
// This constructor is needed for serialization.
///
protected SearchPatternException(SerializationInfo info, StreamingContext context) : base(info, context)
{
}
+#endif
}
}