|
-
Mar 17th, 2005, 04:37 PM
#1
Thread Starter
Junior Member
Reading Serialized Files from Differant Applications
Hi, I'm developing a few programs that require data files to be passed between them by the user. (The majority of programs are editing suites for the main program). I am using serialization to write a structure array to file. I've got it writing and reading fine from within the application but whenever I try to load it in a differant application I get the following complaint:
Code:
Additional information: Cannot find the assembly Factor Creator, Version=1.0.1902.38803, Culture=neutral, PublicKeyToken=null.
Is it possible to get around this? I've tried editing the data in the file, but that won't seem to work. I would be much happier not having to include the editing suite along with the core program for many reasons, but as is that seems like the only way around it. I'm sure there must be another way though. A differant way of reading/writing an a dynamic array of a structure containing dynamic arrays to file would be alright if nothing else is possible.
Cheers in advance.
-
Mar 17th, 2005, 06:01 PM
#2
Re: Reading Serialized Files from Differant Applications
If you're serializing a custom structure/class then you'll have to supply the assembly containing that structure/class to the application that will be deserializing it.
If you don't want to supply the whole "Editing Suite", simply place the Class/Structures you're serializing in a separate assembly.
Regards,
- Aaron.
-
Mar 17th, 2005, 06:41 PM
#3
Thread Starter
Junior Member
Re: Reading Serialized Files from Differant Applications
What exactly do you mean by place them in a seperate assembly?
I've got the exact structure setup in a module of the same name, being read in by an identical procedure in the application i'm trying to read it into, but it gives me the error. I guess thats not what you mean though.
-
Mar 17th, 2005, 11:38 PM
#4
Re: Reading Serialized Files from Differant Applications
In .NET an Assembly is the compiled output of a project.
You'll need to use the same Assembly/DLL to deserialize a serialized instance because versioning information is stored with the binary output when using Binary Serialization, so creating a copy of the same class in another project won't work.
Alternatively you could use XML Serialization which doesn't store versioning information with the serialized data by default.
Regards,
- Aaron.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|