|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Serialization problemI was under the impression that with serialization I could transfer a block of data from one application to another. So I wrote a website where after the user had put in some data, it is put in a structure and that structure is serialized into a file. Then this file is emailed and the backend user reads it in an application for processing. If I try to read the file into the same kind of structure, I get an exception error. Apparently it needs the webpage that generated the file to open it??? This is putting me in a lot of trouble as the website is already in use. Is there a way to read the data from the files without the assembly that created it? Please help me with this!! rg, Eric Probably Yes,
Create in the receiving code, the same class description as in the sending one, and use that to deserialize as the type. Otherwise serialize to XML and send the scheme included. Show quoteHide quote "Eric" <E***@discussions.microsoft.com> wrote in message news:A5C98E7D-8FE4-45B1-8459-5AC9074B36A1@microsoft.com... > Hi, > > I was under the impression that with serialization I could transfer a > block > of data from one application to another. > So I wrote a website where after the user had put in some data, it is put > in > a structure and that structure is serialized into a file. > > Then this file is emailed and the backend user reads it in an application > for processing. > > If I try to read the file into the same kind of structure, I get an > exception error. > Apparently it needs the webpage that generated the file to open it??? > > This is putting me in a lot of trouble as the website is already in use. > > Is there a way to read the data from the files without the assembly that > created it? > > Please help me with this!! > > rg, > Eric > On 27/05/2010 23:03, Eric wrote:
> I was under the impression that with serialization I could transfer a block Sometimes.> of data from one application to another. > So I wrote a website where after the user had put in some data, it is put in That will be because the Type that was created and serialised is > a structure and that structure is serialized into a file. > Then this file is emailed and the backend user reads it in an application > for processing. > If I try to read the file into the same kind of structure, I get an > exception error. /different/ from the Type into which you're trying to deserialise it. Even if you cut and paste the code from one project to the other, it will [almost certainly] not work. A Type defined within one project is /different/ from a Type defined in any other project, even if it looks the identical to the named eye. You need to extract this class into a common library (.dll) and reference this library from both projects (and preferably with the library in the Global Assembly Cache, if you can). That's the /only/ reliable way I've got anything like this to work. HTH, Phill W.
vb.net 2008 professional version question
best solution When is pinning required? enumeration help needed display var value Maximum index on a list is less than the list size Umm.... How to pass a sub into a class...... How do I get back deleted Tab Page DataTable - set a specific row. keep changes are made on datasource. |
|||||||||||||||||||||||