BUG: "<Class Name> does not implement interface member" error message when you build a Visual C# .NET project that you converted from a Java-language class by using JLCA (836670)
The information in this article applies to:
- Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2003), Academic Edition
SYMPTOMSYou can use Java Language Conversion Assistant (JLCA) to
convert a Java-language class that implements the Serializable interface to a project that contains a Microsoft Visual C# .NET class. However, when you try to
build the project, you may receive the following error message: Class Name does not implement
interface member
'System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,
System.Runtime.Serialization.StreamingContext)' Note In this error message, Class Name is a
placeholder for the name of the Java class that you have used JLCA to
convert. CAUSEIn Java, a class that implements the Serializable interface does not have to implement any methods of the
interface. However, in Visual C# .NET, the corresponding converted class must implement
the ISerializable.GetObjectData method.
When JLCA converts the Java-language class, JLCA does not
implement the ISerializable.GetObjectData method. Therefore, you may receive the error message that appears
in the "Symptoms" section of this article.WORKAROUNDTo work around this behavior, implement the ISerializable.GetObjectData method in the converted Visual C# .NET class. To do this, add the
following code in the converted Visual C# .NET class: void System.Runtime.Serialization.ISerializable.GetObjectData(
System.Runtime.Serialization.SerializationInfo info,
System.Runtime.Serialization.StreamingContext context)
{
// Code as required
} STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section of this article.REFERENCESFor more information about ISerializable methods and about JLCA, visit the following MSDN Web
sites:
Modification Type: | Minor | Last Reviewed: | 3/6/2006 |
---|
Keywords: | kbvs2005swept kbvs2005doesnotapply kbpending kbJava kbconvert kbbug KB836670 kbAudDeveloper |
---|
|