473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Deserialization when moving folders

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.

Nov 22 '05 #1
0 726

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sean McFee | last post by:
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...
3
by: umbertoeklat | last post by:
as a proof of concept, am trying create a web app w/ an XML file as a temp DB What is the fastest way to do serialization/deserialization? or maybe the better question would be how to...
3
by: parrot toes | last post by:
Summary: I have been trying to make requests of a web service provided by Axis using a dotnet client with code generated by wsdl.exe and have been getting exceptions when trying to process the...
2
by: Joe | last post by:
We're trying to move our class the does the serialization and deserialization to a separate class library. When deserializing the class the binaryformatter complains about unable to resolve type. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.