Skip to content

Commit 37235c4

Browse files
Remove [Serializable] from OptionException (#73316)
We are no longer introducing [Serializable] exception types unless the library targets both .NET and downlevel. (Serialization of exceptions doesn't work in wasm anyway.) This removes the stray annotation.
1 parent 0736b64 commit 37235c4

1 file changed

Lines changed: 0 additions & 25 deletions

File tree

src/mono/wasm/host/Options.cs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,6 @@
169169
using System.IO;
170170
#if PCL
171171
using System.Reflection;
172-
#else
173-
using System.Runtime.Serialization;
174-
using System.Security.Permissions;
175172
#endif
176173
using System.Text;
177174
using System.Text.RegularExpressions;
@@ -766,9 +763,6 @@ public override bool GetArguments(string value, out IEnumerable<string> replacem
766763
}
767764
#endif
768765

769-
#if !PCL
770-
[Serializable]
771-
#endif
772766
public class OptionException : Exception
773767
{
774768
private string option;
@@ -789,29 +783,10 @@ public OptionException(string message, string optionName, Exception innerExcepti
789783
this.option = optionName;
790784
}
791785

792-
#if !PCL
793-
protected OptionException(SerializationInfo info, StreamingContext context)
794-
: base(info, context)
795-
{
796-
this.option = info.GetString("OptionName");
797-
}
798-
#endif
799-
800786
public string OptionName
801787
{
802788
get { return this.option; }
803789
}
804-
805-
#if !PCL
806-
#pragma warning disable 618 // SecurityPermissionAttribute is obsolete
807-
// [SecurityPermission(SecurityAction.LinkDemand, SerializationFormatter = true)]
808-
#pragma warning restore 618
809-
public override void GetObjectData(SerializationInfo info, StreamingContext context)
810-
{
811-
base.GetObjectData(info, context);
812-
info.AddValue("OptionName", option);
813-
}
814-
#endif
815790
}
816791

817792
public delegate void OptionAction<TKey, TValue>(TKey key, TValue value);

0 commit comments

Comments
 (0)