PC Review


Reply
Thread Tools Rate Thread

Deserialization when moving folders

 
 
Sean McFee
Guest
Posts: n/a
 
      28th Feb 2005
I am using a C# project in .NET and am running into a problem with
deserialization. Previously I have serialized and deserialized these
objects without any problems. However I recently moved some classes
from one assembly to another. This is causing the serialization routine
to be unable to resolve the types saved with the old version of the
code. The error I get is:

Type not resolved for member Foo.Bar.Class1, OldAssembly,
Version=1.0.0.1, Culture=neutral, PublicKeyToken=abcdef123456

The difference is I've moved the class from OldAssembly to NewAssembly.

I have seen an example of someone modifying type and assembly
information at serialization time in an old post, like so:

/// <summary>
/// Method to Serialize object
/// </summary>
/// <param name="info"></param>
/// <param name="context"></param>
[SecurityPermission(SecurityAction.Demand,
SerializationFormatter=true)]
public void GetObjectData(SerializationInfo info, StreamingContext
context)
{
info.FullTypeName = "Framework.Server.Configuration";
info.AssemblyName = "Framework.Server.BusinessContext";
[...]
}

However this method still required the user to serialize the full
assembly name, which is my case is now different.

I am sure someone has run into this problem before. Does anyone have a
solution for this? I am wondering if I need to do something with type
converters, or change how I save things with the old code so that the
new code can resolve the type.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: vista leaves behind folders when moving folders with files in them John Windows Vista General Discussion 0 14th Nov 2008 06:07 PM
Free Moving Estimate, Local Movers, Long Distance Moving, PackingSupplies, Storage Rental, Home Moving, Apartment Moving, Office Moving,Commercial Moving linkswanted Microsoft ASP .NET 0 6th Jan 2008 04:45 AM
Moving User Folders Corrupts Desktop, Favorites, Contacts and Documents Folders fletch Windows Vista General Discussion 0 3rd Nov 2007 02:57 PM
Deserialization when moving folders Sean McFee Microsoft Dot NET Framework 0 28th Feb 2005 07:11 PM
Auto-expand nested/sub-folders not working in Outlook 2003 when copying/moving messages to folders? =?Utf-8?B?SmFzb24=?= Microsoft Outlook 0 27th Feb 2004 12:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:38 PM.