Click here to Skip to main content
15,921,179 members
Home / Discussions / C#
   

C#

 
GeneralRe: Make a method return different types/classes depending on in-parameters Pin
led mike2-Apr-08 5:48
led mike2-Apr-08 5:48 
GeneralRe: Make a method return different types/classes depending on in-parameters Pin
Pete O'Hanlon2-Apr-08 10:13
mvePete O'Hanlon2-Apr-08 10:13 
GeneralRe: Make a method return different types/classes depending on in-parameters Pin
MidwestLimey2-Apr-08 11:38
professionalMidwestLimey2-Apr-08 11:38 
GeneralRe: Make a method return different types/classes depending on in-parameters Pin
Pete O'Hanlon2-Apr-08 22:32
mvePete O'Hanlon2-Apr-08 22:32 
GeneralRe: Make a method return different types/classes depending on in-parameters Pin
arnold_w3-Apr-08 1:17
arnold_w3-Apr-08 1:17 
GeneralC# HTTP request/response Pin
George_George2-Apr-08 2:02
George_George2-Apr-08 2:02 
GeneralCrystal reports how to suppress a section programmatically Pin
NewToAspDotNet2-Apr-08 1:49
NewToAspDotNet2-Apr-08 1:49 
QuestionHow to deserialize the object saved in project1 in another assembly project2? Pin
Chesnokov Yuriy2-Apr-08 1:41
professionalChesnokov Yuriy2-Apr-08 1:41 
I've got some GUI win forms project1 with some class developed say SomeClass. That class has serialization ability to save its object to file and load it later.

SomeClass.Serialize()
{
...
IFormatter formatter = new BinaryFormatter();
formatter.Serialize(stream, this);
...
}

SomeClass SomeClass.Deserialize()
{
using (Stream stream = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.Read))
{
IFormatter formatter = new BinaryFormatter();
return (SomeClass)formatter.Deserialize(stream);
}
}

Now the GUI has assemblyinfo.cs with its assembly AssName1 Wink | ;-) . I run the GUI and serialize the class to file. In that file that AssName is present at the beggining of the file.

Now I have another project2 with different name and assembly name AssName2. I added that SomeClass.cs code to that project and try to deserialize the object from that project.

It says:
can not find assembly "AssName1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"


If I serialize that class from project2 it puts AssName2 to the serialized file. So it seems you can not share the serialized versions of SomeClass between differently named projects?

How can I deserialize the SomeClass object in project2 which was saved in project1?

chesnokov

GeneralRe: How to deserialize the object saved in project1 in another assembly project2? Pin
Simon P Stevens2-Apr-08 3:34
Simon P Stevens2-Apr-08 3:34 
GeneralRe: How to deserialize the object saved in project1 in another assembly project2? Pin
Giorgi Dalakishvili2-Apr-08 4:01
mentorGiorgi Dalakishvili2-Apr-08 4:01 
Generalproblem width Advantech PCI-1730 digital IO card [modified] Pin
arturw822-Apr-08 1:14
arturw822-Apr-08 1:14 
GeneralRe: problem width Advantech PCI-1730 digital IO card Pin
Dave Kreskowiak2-Apr-08 3:52
mveDave Kreskowiak2-Apr-08 3:52 
GeneralRe: problem width Advantech PCI-1730 digital IO card Pin
arturw822-Apr-08 4:13
arturw822-Apr-08 4:13 
GeneralRe: problem width Advantech PCI-1730 digital IO card Pin
Dave Kreskowiak2-Apr-08 5:00
mveDave Kreskowiak2-Apr-08 5:00 
Generalcrystal reporting with C# Pin
Faysal2-Apr-08 1:12
Faysal2-Apr-08 1:12 
QuestionRe: crystal reporting with C# Pin
Pankaj Garg2-Apr-08 1:18
Pankaj Garg2-Apr-08 1:18 
Generalword Pin
ellllllllie2-Apr-08 1:04
ellllllllie2-Apr-08 1:04 
GeneralRe: word Pin
Pete O'Hanlon2-Apr-08 1:50
mvePete O'Hanlon2-Apr-08 1:50 
GeneralRe: word Pin
ellllllllie2-Apr-08 1:54
ellllllllie2-Apr-08 1:54 
GeneralRe: word Pin
Giorgi Dalakishvili2-Apr-08 4:01
mentorGiorgi Dalakishvili2-Apr-08 4:01 
QuestionSharePoint WebPart TreeView Control Problem Pin
Member 42541792-Apr-08 1:00
Member 42541792-Apr-08 1:00 
Questionexport datatable to .csv format in windows application Pin
sharanabasava2-Apr-08 0:40
sharanabasava2-Apr-08 0:40 
GeneralRe: export datatable to .csv format in windows application Pin
Stu Richardson2-Apr-08 2:09
Stu Richardson2-Apr-08 2:09 
Questionmerging the first line of excel in c# Pin
Pankaj Garg2-Apr-08 0:39
Pankaj Garg2-Apr-08 0:39 
GeneralXml Serialization with C# Pin
RichardContact-12-Apr-08 0:28
RichardContact-12-Apr-08 0:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.