websocket-sharp icon indicating copy to clipboard operation
websocket-sharp copied to clipboard

websocket-sharp\Net\CookieException.cs(10,10): Error CS0540: 'WebSocketSharp.Net.CookieException.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)': containing type does not implement interface 'System.Runtime.Serialization.ISerializable' (CS0540) (websocket-sharp)

Open The-MAZZTer opened this issue 7 years ago • 3 comments

Build error in r3427. Occurs when building for Release in VS2017 and MonoDevelop.

Inheritance from ISerializable seems to have been removed in r3410 (r3409 builds properly).

Commit log does not reveal what the intent was but I suspect the implemented functions should have been removed.

Removing the explicitly implemented functions allows the build to complete successfully in r3427 (but I am not sure if this is the correct fix).

Index: websocket-sharp/Net/CookieException.cs
===================================================================
--- websocket-sharp/Net/CookieException.cs      (revision 3409)
+++ websocket-sharp/Net/CookieException.cs      (revision 3410)
@@ -46,7 +46,7 @@
   /// The exception that is thrown when a <see cref="Cookie"/> gets an error.
   /// </summary>
   [Serializable]
-  public class CookieException : FormatException, ISerializable
+  public class CookieException : FormatException
   {
     #region Internal Constructors


Property changes on: websocket-sharp/Net/CookieException.cs
___________________________________________________________________

The-MAZZTer avatar May 28 '19 20:05 The-MAZZTer

I have some workaround. You have to add ISerializable to the class. public class CookieException : FormatException, ISerializable this should be fix the issues without delete code.

qapquiz avatar Jun 09 '19 13:06 qapquiz

I have some workaround. You have to add ISerializable to the class. public class CookieException : FormatException, ISerializable this should be fix the issues without delete code.

Thanks, this worked great and the websocket-sharp.dll compiled fine in VS Code.

kpvr avatar Jul 18 '19 20:07 kpvr

I have some workaround. You have to add ISerializable to the class. public class CookieException : FormatException, ISerializable this should be fix the issues without delete code.

Thanks a lot, helps here also!

raslab avatar Oct 03 '19 20:10 raslab