473,396 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Serialisation fails, but without any errors being thrown.

I have a bizarre situation in which serialisation is failing routinely
under a specific condition, and I'm wondering if the details ring a
bell with anyone here.

I have 2 classes that my application serialises before closing down.
One of these classes contains a string field which contains a path to a
file. This is populated from the contents of a text box, which in turn
is populated using an OpenFileFialog object.

Under normal usage, the 2 classes always fail to be serialised.
However, if a path is manually typed into the text box mentioned above,
serialisation works. At the point of serialisation, I've checked that
the field corresponding to the file path is the same, regardless of how
the path was entered into the text box (typed or using an
OpenFileDialog object).

This is absolute madness - why should the fact that an OpenFileDialog
box has been used at some point in the application's lifetime mean
that serialisation fails?

Stepping through the serialisation (done using the BinaryFormatter), I
can't see any obvious problems and certainly no errors are being
thrown.

I'm confident that the OpenFileDialog object is relevant to the
problem as whether it is used or not is the sole user action that
defines whether serialisation works or not.

For what its worth, I use different BinaryFormatter objects for
serialising the two classes (they are local to the method they are
used in).

Please spare me from insanity!

Greg

Sep 7 '06 #1
2 1302
Greg,

Can you post simple compilable sample the demonstrates the problem and we
can fiddle with.
--
Stoitcho Goutsev (100)

"Greg" <gr*************@yahoo.co.ukwrote in message
news:11**********************@d34g2000cwd.googlegr oups.com...
>I have a bizarre situation in which serialisation is failing routinely
under a specific condition, and I'm wondering if the details ring a
bell with anyone here.

I have 2 classes that my application serialises before closing down.
One of these classes contains a string field which contains a path to a
file. This is populated from the contents of a text box, which in turn
is populated using an OpenFileFialog object.

Under normal usage, the 2 classes always fail to be serialised.
However, if a path is manually typed into the text box mentioned above,
serialisation works. At the point of serialisation, I've checked that
the field corresponding to the file path is the same, regardless of how
the path was entered into the text box (typed or using an
OpenFileDialog object).

This is absolute madness - why should the fact that an OpenFileDialog
box has been used at some point in the application's lifetime mean
that serialisation fails?

Stepping through the serialisation (done using the BinaryFormatter), I
can't see any obvious problems and certainly no errors are being
thrown.

I'm confident that the OpenFileDialog object is relevant to the
problem as whether it is used or not is the sole user action that
defines whether serialisation works or not.

For what its worth, I use different BinaryFormatter objects for
serialising the two classes (they are local to the method they are
used in).

Please spare me from insanity!

Greg

Sep 8 '06 #2
Stoitcho,

Thanks, I sorted it in the end. I was using a relative file path for
the serialisation, and the opening of the openfiledialog box was
changing the working file path.

Regards,

Greg.

Stoitcho Goutsev (100) wrote:
Greg,

Can you post simple compilable sample the demonstrates the problem and we
can fiddle with.
--
Stoitcho Goutsev (100)

"Greg" <gr*************@yahoo.co.ukwrote in message
news:11**********************@d34g2000cwd.googlegr oups.com...
I have a bizarre situation in which serialisation is failing routinely
under a specific condition, and I'm wondering if the details ring a
bell with anyone here.

I have 2 classes that my application serialises before closing down.
One of these classes contains a string field which contains a path to a
file. This is populated from the contents of a text box, which in turn
is populated using an OpenFileFialog object.

Under normal usage, the 2 classes always fail to be serialised.
However, if a path is manually typed into the text box mentioned above,
serialisation works. At the point of serialisation, I've checked that
the field corresponding to the file path is the same, regardless of how
the path was entered into the text box (typed or using an
OpenFileDialog object).

This is absolute madness - why should the fact that an OpenFileDialog
box has been used at some point in the application's lifetime mean
that serialisation fails?

Stepping through the serialisation (done using the BinaryFormatter), I
can't see any obvious problems and certainly no errors are being
thrown.

I'm confident that the OpenFileDialog object is relevant to the
problem as whether it is used or not is the sole user action that
defines whether serialisation works or not.

For what its worth, I use different BinaryFormatter objects for
serialising the two classes (they are local to the method they are
used in).

Please spare me from insanity!

Greg
Sep 11 '06 #3

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

Similar topics

7
by: Jorge Schramm | last post by:
Hi, a collegue of mine is trying to write a serialisable container (reads at construction, writes at destruction). The writing part is pretty easy: simply iterate through the container and...
1
by: BrentonMCA | last post by:
I want to be able to serialise an object and then pass the serialisation text as a string to a Web service without serialising to a file first. I also want to be able to deserialise from the text...
9
by: BoloBaby | last post by:
I have an extremely vexing problem occurring in a program that I am writing. Consider the following block of code: Dim pDancer As New BEDancer mintIndex = mintIndex + 1 pDancer.DancerName =...
7
by: Danny Tuppeny | last post by:
Hi All, I've been going through Google Groups, but nothing seems to quite match my problem. It's hard to post a WSDL or anything at the moment (it's not my service, I'm just using it), but maybe...
1
by: David Herbst | last post by:
Enterprise Library Jan 2006 with Visual Studio 2005 on Windows 2000 Server sp4. My custom exception formatter fails with a "Unable to handle exception: 'LoggingExceptionHandler'." exception. ...
1
by: OrionLee | last post by:
I am using C# to work with a 3rd party DLL (Nevron Charts), and attempting to serialise it. The serialisation itself is handled somewhere inside the DLL, so to get it to happen you call the Nevron's...
0
by: =?Utf-8?B?Sm9obiBPbGJlcnQ=?= | last post by:
We have an application that merges menus. It is written in English but we expected it to run without problems on a copy of a French XpSp2 installation (in English of course). It does run but the...
3
by: Michael Sharman | last post by:
Hi guys, I'm somewhat new to PHP, so please excuse what I hope is an easy question. I've experienced some issues lately where the code on my development environment throws no errors, but when...
6
by: JDeats | last post by:
I'm in a situation where it's difficult to get on-site and troubleshoot, so I'm looking for scenarios from those experienced on what might be causing this problem. I have a .NET 2.0 WinForms...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.