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 3 1381
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
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Alexander Korovyev |
last post by:
Hello,
What are the possible ways to make a GUI application start
automatically and run in a usual fashion (i.e. with a capability to
create windows) when mssqlserver starts?
|
by: Michiganblkman |
last post by:
This has just started to happen lately. I am currently running VB6 and
VS.NET (2003) on the same machine. (Windows 2000 professional). Everything
has been operating fine over the last month,...
|
by: ptass |
last post by:
If i create a simple windows form .exe then launch it via a href, why does
the .net framework/iis search in multiple places and for multiple files
derived from the actual .exe name. ( most of which...
|
by: ptass |
last post by:
If i create a simple windows form .exe then launch it via a href, ( simple
one touch deployment ), why does
the .net framework/iis search in multiple places and for multiple files
derived from the...
|
by: Scott Zabolotzky |
last post by:
I'm using the following code to launch SIGNCODE.EXE to sign a CAB
provisioning file from an ASP.NET app. When I run the code the
exit code comes back as -1. I have not been able to determine what...
|
by: duzinga |
last post by:
I am trying to have a server program that runs at startup and accepts several
commands from the clients. One of the commands is to play an audio file. I am
using...
|
by: MIke Brown |
last post by:
Hello all,
I've been searching for a solution on google for a problem related to
creating events from a worker thread, with no luck..
Basically, the problem is when my events are caught by a...
|
by: Water Cooler v2 |
last post by:
I have a Windows Service I am writing in C# and a set of, let us say
three, other executables written in C# (mostly console applications).
I want that the Windows Service must do so every few...
|
by: microb0x |
last post by:
Is there any difference in the way an Access .mdb file is launched from
directly double-clicking the file through windows explorer versus using
code within another Access file to launch the...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |