By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,934 Members | 1,804 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,934 IT Pros & Developers. It's quick & easy.

Launching app on startup gives error

P: n/a
I have written a C# application that runs fine from within the IDE,
and also when I invoke it via the Windows 'Run' dialog or from
explorer. I am trying to make the app launch automatically when
windows starts, and have placed a registry value under
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Run
to run the .exe. This worked for a while, but now I have added some
code which performs deserialization of some data as the app starts up,
and this is throwing errors, but only when the app is invoked via the
registry as windows starts - otherwise, no errors and everything works
fine. I have tried both binary and xml serialization, as well as
custom serialization via ISerializable - nothing works.

This is the error I get when using XML serialization:
System.InvalidOperationException: There is an error in XML document
(0, 0). ---> System.ArgumentException: Invalid byte was found at byte
index 5.
however the document looked fine to me when I opened it in a text
editor

The binary formatter gave this error:
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --->
System.Runtime.Serialization.SerializationExceptio n: Member
dlSecondBuffer was not found.
the member it mentions *was* in the object, and could be accessed
normally when the app was launched 'by hand'

Could this be a permissions issue? Any other ideas?
many thanks for your help
rob

Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
rob2 wrote:
I have written a C# application that runs fine from within the IDE,
and also when I invoke it via the Windows 'Run' dialog or from
explorer. I am trying to make the app launch automatically when
windows starts, and have placed a registry value under
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Run
to run the .exe. This worked for a while, but now I have added some
code which performs deserialization of some data as the app starts up,
and this is throwing errors, but only when the app is invoked via the
registry as windows starts - otherwise, no errors and everything works
fine. I have tried both binary and xml serialization, as well as
custom serialization via ISerializable - nothing works.

This is the error I get when using XML serialization:
System.InvalidOperationException: There is an error in XML document
(0, 0). ---> System.ArgumentException: Invalid byte was found at byte
index 5.
however the document looked fine to me when I opened it in a text
editor

The binary formatter gave this error:
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --->
System.Runtime.Serialization.SerializationExceptio n: Member
dlSecondBuffer was not found.
the member it mentions *was* in the object, and could be accessed
normally when the app was launched 'by hand'

Could this be a permissions issue? Any other ideas?
many thanks for your help
rob

Well, i would try to put the autostart key to
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Curr entVersion\Run
instead of HKEY_CURRENT_USER and check what happens

Andrey
Nov 16 '05 #2

P: n/a
On Wed, 29 Dec 2004 12:50:36 -0500, MuZZy <le*******@yahoo.com> wrote:

Well, i would try to put the autostart key to
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Cur rentVersion\Run
instead of HKEY_CURRENT_USER and check what happens

Andrey


It does the same thing unfortunately - that was one of the things I
tried, but thanks anyway

rob
Nov 16 '05 #3

P: n/a
On Wed, 29 Dec 2004 15:38:22 +0000, rob2 <st**@nothing.com> wrote:
I have written a C# application that runs fine from within the IDE,
and also when I invoke it via the Windows 'Run' dialog or from
explorer. I am trying to make the app launch automatically when
windows starts, and have placed a registry value under
HKEY_CURRENT_USER\Software\Microsoft\Windows\Curr entVersion\Run
to run the .exe. This worked for a while, but now I have added some
code which performs deserialization of some data as the app starts up,
and this is throwing errors, but only when the app is invoked via the
registry as windows starts - otherwise, no errors and everything works
fine. I have tried both binary and xml serialization, as well as
custom serialization via ISerializable - nothing works.

This is the error I get when using XML serialization:
System.InvalidOperationException: There is an error in XML document
(0, 0). ---> System.ArgumentException: Invalid byte was found at byte
index 5.
however the document looked fine to me when I opened it in a text
editor

The binary formatter gave this error:
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. --->
System.Runtime.Serialization.SerializationExcepti on: Member
dlSecondBuffer was not found.
the member it mentions *was* in the object, and could be accessed
normally when the app was launched 'by hand'

Could this be a permissions issue? Any other ideas?
many thanks for your help
rob


I know this is a busy group, but does anyone have any thoughts on
this? - my application is basically ready now apart from this issue,
and I cant see a way around it
thanks
rob
Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.