Serilization fails due to object in explicit operator

K

ken_Ident

I have an object that is marked as [serializable]. When I try to serilize
the object it fails with the famous tempory file not found error :
Error: File or assembly name xogis39n.dll, or one of its dependencies, was
not found.

The actual error using a debug tool that caused the above error is

c:\Documents and Settings\kenm\Local Settings\Temp\xogis39n.0.cs(16,21):
error CS0012: The type 'EPoS.Common.DataSale' is defined in an assembly that
is not referenced. You must add a reference to assembly 'Common'.
BusinessRules.dll: (Location of symbol related to previous error)

The Common.DataSale object that it is referring to only appears in the
object when used in ecplicit operator conversion.

public static explicit operator DataSale(Sale S)
{
Do somethings ...
}

public static explicit operator Sale(DataSale S)
{
Do Somethings ...
}

The question is why is the serilization even looking at these operators and
more importantly how do I stop the error.
 
D

Dan Rogers

If your WS contract uses classes that have these operations in them, you
are going to experience serialization issues. Statics aren't serializable,
for one.

But I'd try to do what the error message says - add a reference to the
missing DLL so that the serializer can at least try!

--------------------
 
K

Ken_Ident

I figured out what needed to be done. It needs an XmlInclude attribute added
to the class for the module it complains about.



Dan Rogers said:
If your WS contract uses classes that have these operations in them, you
are going to experience serialization issues. Statics aren't serializable,
for one.

But I'd try to do what the error message says - add a reference to the
missing DLL so that the serializer can at least try!

--------------------
Thread-Topic: Serilization fails due to object in explicit operator
thread-index: AcUbZJB6wqqPC/UzTH6M4SBriPrWEQ==
X-WBNR-Posting-Host: 80.45.186.177
From: =?Utf-8?B?a2VuX0lkZW50?= <[email protected]>
Subject: Serilization fails due to object in explicit operator
Date: Fri, 25 Feb 2005 10:05:18 -0800
Lines: 31
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework.aspnet.webservices:28302
X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices

I have an object that is marked as [serializable]. When I try to serilize
the object it fails with the famous tempory file not found error :
Error: File or assembly name xogis39n.dll, or one of its dependencies, was
not found.

The actual error using a debug tool that caused the above error is

c:\Documents and Settings\kenm\Local Settings\Temp\xogis39n.0.cs(16,21):
error CS0012: The type 'EPoS.Common.DataSale' is defined in an assembly that
is not referenced. You must add a reference to assembly 'Common'.
BusinessRules.dll: (Location of symbol related to previous error)

The Common.DataSale object that it is referring to only appears in the
object when used in ecplicit operator conversion.

public static explicit operator DataSale(Sale S)
{
Do somethings ...
}

public static explicit operator Sale(DataSale S)
{
Do Somethings ...
}

The question is why is the serilization even looking at these operators and
more importantly how do I stop the error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top