Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SoapFormatter Deserialize - Parse Error, no assembly associated with Xml key

278 views
Skip to first unread message

Udi

unread,
May 7, 2009, 8:47:44 AM5/7/09
to roy...@gmail.com
Hi,
I'm having problems deserializing my class using SoapFormatter.
I have a process that dynamically loads an assembly ‘A’.
Assembly ‘A’ in turn implicitly loads assembly ‘B’ that contains the
serialzed class and the deserialization code (see below).

However, in case assembly ‘B’ is located in a folder different than
the process’s current working directory
I get the following exception:
“Parse Error, no assembly associated with Xml key a1:http://
schemas.microsoft.com/clr/nsassem/….”

When moving assembly ‘B’ to the process current directory, everything
works fine.

Does anyone know what is the cause of this problem and how can I get
over it?
Thanks,
Udi

[Serializable]
public class ChipLabProps
{
:
:
}

public ChipLabProps LoadProps()
{
using (FileStream fileStream = new FileStream(propFileName,
FileMode.OpenOrCreate, FileAccess.Read))
{
IFormatter formatter = new SoapFormatter();

return (ChipLabProps)formatter.Deserialize(fileStream);
}
}

not_a_commie

unread,
May 7, 2009, 11:38:11 AM5/7/09
to
The AppDomain class has some methods for adding private search paths.
Use that to include your other folder. You could also preload the
assembly directly using AppDomain.Load or Assembly.Load.

Paul

unread,
May 11, 2009, 10:40:12 AM5/11/09
to
I think you need to give us a full code example. Are you using Assembly.Load
or instantiating an object using SOAP.

I presume these are model objects so my next question is why seperate out
model objects.....


"Udi" <UdiBen...@gmail.com> wrote in message
news:b51fd9a0-7ba7-479b...@b1g2000vbc.googlegroups.com...

0 new messages