472,799 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,799 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.

Jul 21 '05 #1
0 838

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

Similar topics

2
by: Snowman | last post by:
Suppose I have a RootObject which holds a collection of other objects. The other objects have a property (Parent) which refers back to the "parent" collection (b.t.w. my collection is based on...
3
by: Amadelle | last post by:
Hi all and thanks in advance for your help, I am having problems deserializing an object which seems to be serializing just fine. I save the byte array of the serialized object in the database...
3
by: AnkitAsDeveloper [Ankit] | last post by:
Hi i am serializing a 'ref struct' object as follows : private: void Seri( String ^path, Object^ obj ) { FileStream^ fileStrm ; try { //Serialize entire object into Binary stream
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...
1
by: parrot toes | last post by:
I tried to post this question before, but there was an error when posting. I case it did get posted and in order to avoid duplication, I'll just repost a summary. I have written a dotnet client...
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...
8
by: ashoksrini | last post by:
Hi All, I have the below requirement and would like to get some feeback from the group on the best way to implement: 1. I have WSDL defined exposing few web services. 2. We dont have a...
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.