Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Serialization problem
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Phil  
View profile  
 More options Oct 12, 7:11 pm
Newsgroups: microsoft.public.dotnet.framework
From: "Phil" <p>
Date: Mon, 12 Oct 2009 10:11:33 +0100
Local: Mon, Oct 12 2009 7:11 pm
Subject: Serialization problem
I am trying to use binary serialisation to store and retrieve objects from
file and to/from a database. This all seemed to work fine when running in
the IDE, but when I build a release version of my application, it no longer
reads the data from the files that I have generated, nor from the database
that I have written to with the debug version.I don't get any error
messages, I just get all my properties set to nothing.. This application is
likely to be under continual development for some time, so I will need to be
able to access the same data with both the debug and release versions.

Any suggestions appreciated.
TIA
Phil.

PS. I have also tried using the XMLSerializer (I would prefer binary as it
is more compact for storage in a database), but I get an error indicating
that multi-dimensional arrays are not supported.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil  
View profile  
 More options Oct 13, 12:40 am
Newsgroups: microsoft.public.dotnet.framework
From: "Phil" <p>
Date: Mon, 12 Oct 2009 15:40:25 +0100
Local: Tues, Oct 13 2009 12:40 am
Subject: Re: Serialization problem

>I am trying to use binary serialisation to store and retrieve objects from
>file and to/from a database. This all seemed to work fine when running in
>the IDE, but when I build a release version of my application, it no longer
>reads the data from the files that I have generated, nor from the database
>that I have written to with the debug version.

Seems to be working now.
I think it may have just have been an issue with file locations.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil  
View profile  
 More options Oct 14, 11:59 pm
Newsgroups: microsoft.public.dotnet.framework
From: "Phil" <p>
Date: Wed, 14 Oct 2009 14:59:40 +0100
Local: Wed, Oct 14 2009 11:59 pm
Subject: Re: Serialization problem

"Phil" <p> wrote in message

news:0pednSC-iudHok7XnZ2dnUVZ8q-dnZ2d@brightview.co.uk...

> >I am trying to use binary serialisation to store and retrieve objects
> >from file and to/from a database. This all seemed to work fine when
> >running in the IDE, but when I build a release version of my application,
> >it no longer reads the data from the files that I have generated, nor
> >from the database that I have written to with the debug version.

> Seems to be working now.
> I think it may have just have been an issue with file locations.

Well I thought it had started working, but it's failing again now.
When I run from the VB IDE it all works fine, and when I run my deployed
application it all works fine, but if I try to use a file created when
running under the IDE it will not deserialise properly when running my
deployed application and vice versa.

Any suggestions appreciated.

My serialisation code is very simple:

    ' serialise:
    With New BinaryFormatter
        .Serialize(MyStream, MyObj)
    End With

    ' de-serialise:
    MyObj= (New BinaryFormatter).Deserialize(Stream)


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Benson  
View profile  
 More options Oct 15, 8:14 pm
Newsgroups: microsoft.public.dotnet.framework
From: "Adam Benson" <Adam.Ben...@community.nospam>
Date: Thu, 15 Oct 2009 11:14:37 +0100
Local: Thurs, Oct 15 2009 8:14 pm
Subject: Re: Serialization problem

>> it will not deserialise properly when running my deployed application and
>> vice versa

What happens? You get an object back but its corrupt? You get an exception?

If you get an exception what is it?

Cheers,

Adam.
=========


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil  
View profile  
 More options Oct 16, 1:41 am
Newsgroups: microsoft.public.dotnet.framework
From: "Phil" <p>
Date: Thu, 15 Oct 2009 16:41:06 +0100
Local: Fri, Oct 16 2009 1:41 am
Subject: Re: Serialization problem

> What happens? You get an object back but its corrupt? You get an
> exception?

No exception. I get an object but all the properties are set to Nothing. The
properties are all arrays of Double or arrays of String.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil  
View profile  
 More options Oct 16, 2:31 am
Newsgroups: microsoft.public.dotnet.framework
From: "Phil" <p>
Date: Thu, 15 Oct 2009 17:31:32 +0100
Local: Fri, Oct 16 2009 2:31 am
Subject: Re: Serialization problem
I have done a bit more testing, and I think the problem may be to do with
versioning. I get the same problem if I serialise to a file, and then
rebuild and re-deploy the application. The new version does not seem to want
to deserialise the data produced with the old version.
I have tried setting
    AssemblyFormat = Formatters.FormatterAssemblyStyle.Simple
before the Serialze and Deserialize
calls, but this doesn't seem to make any difference.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Adam Benson  
View profile  
 More options Oct 21, 6:25 pm
Newsgroups: microsoft.public.dotnet.framework
From: "Adam Benson" <Adam.Ben...@community.nospam>
Date: Wed, 21 Oct 2009 09:25:25 +0100
Local: Wed, Oct 21 2009 6:25 pm
Subject: Re: Serialization problem
Something may be blowing up behind the scenes as its deserializing which is
why your object has nothing in it. Try using DbgView to see if there are any
exceptions being thrown as your object is deserializing.

AB

"Phil" <p> wrote in message

news:BI6dnbJJLov400rXnZ2dnUVZ8v6dnZ2d@brightview.co.uk...


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phil  
View profile  
 More options Nov 4, 9:20 pm
Newsgroups: microsoft.public.dotnet.framework
From: "Phil" <p>
Date: Wed, 4 Nov 2009 10:20:00 -0000
Subject: Re: Serialization problem

"Adam Benson" <Adam.Ben...@community.nospam> wrote in message

news:O4ixLgiUKHA.1236@TK2MSFTNGP05.phx.gbl...
> Something may be blowing up behind the scenes as its deserializing which
> is why your object has nothing in it. Try using DbgView to see if there
> are any exceptions being thrown as your object is deserializing.

Thanks Adam,

I've left this for a while, as I didn't seem to be getting anywhere, but I
will need to come back to it soon.
I haven't used DbgView, so I'll take a look at that, and see if it helps to
shed any light on the problem. Is this something included with VS2008, or is
it something extra I need to download?
I did do some further tests last week, and I think my original assumption
was correct, that the problem is an incompatibuility between the release and
debug versions, not anything to do with the version number of the
assemblies. It is a very simple class, just a few private member variables
(mostly arrays of double or string) with public properties to get/set the
values.
I did have an additional complication that my assemblies were being loaded
from a database in the released version rather than directly from a DLL, but
I have moved these classes into a separate new DLL, and I still have the
problem.

Thanks
Phil.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google