Skip to content

Commit 54329f0

Browse files
Remove serializable attribute and throw PNSE.
* Specifically on WCF Exceptions.
1 parent 9ccd6bd commit 54329f0

24 files changed

+26
-54
lines changed

src/System.Private.ServiceModel/src/Internals/System/Runtime/FatalException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace System.Runtime
88
{
9-
[Serializable]
109
internal class FatalException : Exception
1110
{
1211
public FatalException()
@@ -25,6 +24,7 @@ public FatalException(string message, Exception innerException) : base(message,
2524

2625
protected FatalException(SerializationInfo info, StreamingContext context) : base(info, context)
2726
{
27+
throw new PlatformNotSupportedException();
2828
}
2929
}
3030
}

src/System.Private.ServiceModel/src/Internals/System/Runtime/Fx.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,6 @@ private void UnhandledExceptionFrame(IAsyncResult result)
10071007
}
10081008
}
10091009

1010-
[Serializable]
10111010
internal class InternalException : Exception
10121011
{
10131012
public InternalException(string description)
@@ -1018,6 +1017,7 @@ public InternalException(string description)
10181017
protected InternalException(SerializationInfo info, StreamingContext context)
10191018
: base(info, context)
10201019
{
1020+
throw new PlatformNotSupportedException();
10211021
}
10221022
}
10231023

@@ -1032,6 +1032,7 @@ public FatalInternalException(string description)
10321032
protected FatalInternalException(SerializationInfo info, StreamingContext context)
10331033
: base(info, context)
10341034
{
1035+
throw new PlatformNotSupportedException();
10351036
}
10361037
}
10371038
}

src/System.Private.ServiceModel/src/System/IdentityModel/SecurityMessageSerializationException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace System.IdentityModel
88
{
9-
[Serializable]
109
public class SecurityMessageSerializationException : Exception
1110
{
1211
public SecurityMessageSerializationException()
@@ -27,6 +26,7 @@ public SecurityMessageSerializationException(String message, Exception innerExce
2726
protected SecurityMessageSerializationException(SerializationInfo info, StreamingContext context)
2827
: base(info, context)
2928
{
29+
throw new PlatformNotSupportedException();
3030
}
3131
}
3232
}

src/System.Private.ServiceModel/src/System/IdentityModel/Tokens/SecurityTokenException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace System.IdentityModel.Tokens
88
{
9-
[Serializable]
109
public class SecurityTokenException : Exception
1110
{
1211
public SecurityTokenException()
@@ -27,6 +26,7 @@ public SecurityTokenException(String message, Exception innerException)
2726
protected SecurityTokenException(SerializationInfo info, StreamingContext context)
2827
: base(info, context)
2928
{
29+
throw new PlatformNotSupportedException();
3030
}
3131
}
3232
}

src/System.Private.ServiceModel/src/System/IdentityModel/Tokens/SecurityTokenValidationException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
namespace System.IdentityModel.Tokens
88
{
9-
[Serializable]
109
public class SecurityTokenValidationException : SecurityTokenException
1110
{
1211
public SecurityTokenValidationException()
@@ -27,6 +26,7 @@ public SecurityTokenValidationException(String message, Exception innerException
2726
protected SecurityTokenValidationException(SerializationInfo info, StreamingContext context)
2827
: base(info, context)
2928
{
29+
throw new PlatformNotSupportedException();
3030
}
3131
}
3232
}

src/System.Private.ServiceModel/src/System/ServiceModel/ActionMismatchAddressingException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
namespace System.ServiceModel
1010
{
11-
[Serializable]
1211
internal class ActionMismatchAddressingException : ProtocolException
1312
{
1413
private string _httpActionHeader;
@@ -24,6 +23,7 @@ public ActionMismatchAddressingException(string message, string soapActionHeader
2423
protected ActionMismatchAddressingException(SerializationInfo info, StreamingContext context)
2524
: base(info, context)
2625
{
26+
throw new PlatformNotSupportedException();
2727
}
2828

2929
public string HttpActionHeader

src/System.Private.ServiceModel/src/System/ServiceModel/ActionNotSupportedException.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@
99

1010
namespace System.ServiceModel
1111
{
12-
[Serializable]
1312
public class ActionNotSupportedException : CommunicationException
1413
{
1514
public ActionNotSupportedException() { }
1615
public ActionNotSupportedException(string message) : base(message) { }
17-
public ActionNotSupportedException(string message, Exception innerException) : base(message, innerException) { }
16+
public ActionNotSupportedException(string message, Exception innerException) : base(message, innerException) { throw new PlatformNotSupportedException(); }
1817
protected ActionNotSupportedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
1918

2019
internal Message ProvideFault(MessageVersion messageVersion)

src/System.Private.ServiceModel/src/System/ServiceModel/ChannelTerminatedException.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66

77
namespace System.ServiceModel
88
{
9-
[Serializable]
109
public class ChannelTerminatedException : CommunicationException
1110
{
1211
public ChannelTerminatedException() { }
1312
public ChannelTerminatedException(string message) : base(message) { }
1413
public ChannelTerminatedException(string message, Exception innerException) : base(message, innerException) { }
15-
protected ChannelTerminatedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
14+
protected ChannelTerminatedException(SerializationInfo info, StreamingContext context) : base(info, context) { throw new PlatformNotSupportedException(); }
1615
}
1716
}

src/System.Private.ServiceModel/src/System/ServiceModel/CommunicationException.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66

77
namespace System.ServiceModel
88
{
9-
[Serializable]
109
public class CommunicationException : Exception
1110
{
1211
public CommunicationException() { }
1312
public CommunicationException(string message) : base(message) { }
1413
public CommunicationException(string message, Exception innerException) : base(message, innerException) { }
15-
protected CommunicationException(SerializationInfo info, StreamingContext context) : base(info, context) { }
14+
protected CommunicationException(SerializationInfo info, StreamingContext context) : base(info, context) { throw new PlatformNotSupportedException(); }
1615
}
1716
}

src/System.Private.ServiceModel/src/System/ServiceModel/CommunicationObjectAbortedException.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66

77
namespace System.ServiceModel
88
{
9-
[Serializable]
109
public class CommunicationObjectAbortedException : CommunicationException
1110
{
1211
public CommunicationObjectAbortedException() { }
1312
public CommunicationObjectAbortedException(string message) : base(message) { }
1413
public CommunicationObjectAbortedException(string message, Exception innerException) : base(message, innerException) { }
15-
protected CommunicationObjectAbortedException(SerializationInfo info, StreamingContext context) : base(info, context) { }
14+
protected CommunicationObjectAbortedException(SerializationInfo info, StreamingContext context) : base(info, context) { throw new PlatformNotSupportedException(); }
1615
}
1716
}

0 commit comments

Comments
 (0)