Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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) #544

Open
The-MAZZTer opened this issue May 28, 2019 · 3 comments

Comments

@The-MAZZTer
Copy link

The-MAZZTer commented May 28, 2019

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
___________________________________________________________________
@qapquiz
Copy link

qapquiz commented Jun 9, 2019

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.

@kpvr
Copy link

kpvr commented Jul 18, 2019

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.

@raslab
Copy link

raslab commented Oct 3, 2019

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!

sta added a commit that referenced this issue Nov 14, 2019
Inherit the ISerializable interface again because some build environments get an error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants