473,772 Members | 3,672 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Launching app on startup gives error

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_US ER\Software\Mic rosoft\Windows\ CurrentVersion\ 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.InvalidO perationExcepti on: There is an error in XML document
(0, 0). ---> System.Argument Exception: 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.Reflecti on.TargetInvoca tionException: Exception has been thrown
by the target of an invocation. --->
System.Runtime. Serialization.S erializationExc eption: 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
3 1395
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_US ER\Software\Mic rosoft\Windows\ CurrentVersion\ 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.InvalidO perationExcepti on: There is an error in XML document
(0, 0). ---> System.Argument Exception: 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.Reflecti on.TargetInvoca tionException: Exception has been thrown
by the target of an invocation. --->
System.Runtime. Serialization.S erializationExc eption: 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_MACH INE\Software\Mi crosoft\Windows \CurrentVersion \Run
instead of HKEY_CURRENT_US ER and check what happens

Andrey
Nov 16 '05 #2
On Wed, 29 Dec 2004 12:50:36 -0500, MuZZy <le*******@yaho o.com> wrote:

Well, i would try to put the autostart key to
HKEY_LOCAL_MAC HINE\Software\M icrosoft\Window s\CurrentVersio n\Run
instead of HKEY_CURRENT_US ER 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
On Wed, 29 Dec 2004 15:38:22 +0000, rob2 <st**@nothing.c om> 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_U SER\Software\Mi crosoft\Windows \CurrentVersion \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.Invalid OperationExcept ion: There is an error in XML document
(0, 0). ---> System.Argument Exception: 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.Reflect ion.TargetInvoc ationException: Exception has been thrown
by the target of an invocation. --->
System.Runtime .Serialization. SerializationEx ception: Member
dlSecondBuff er 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
470
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?
2
1217
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, however, as of late, when I go to start VB6, windows installer tries to install VS.NET (its already installed). When I click 'cancel' at the installation prompts, my VB6 startup stalls and shows 'not responding' in the task manager. Consequently, I cant...
0
862
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 don't exist ) eg; 2005-03-01 04:47:35 10.2.5.229 GET /Components/Softix.Platform.Application.Startup.exe - 80 - 10.2.5.232 200 0 0 16621 314 15 2005-03-01 04:47:40 10.2.5.229 GET /Components/Softix.Platform.Application.Startup.DLL - 80 -...
5
1511
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 actual .exe name. ( most of which don't exist ) eg; 2005-03-01 04:47:35 10.2.5.229 GET /Components/Softix.Platform.Application.Startup.exe - 80 - 10.2.5.232 200 0 0 16621 314 15 2005-03-01 04:47:40 10.2.5.229 GET
0
1701
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 this exit code means (other than Error, as the CAB file does not get signed). No exceptions are thrown and I've verified that the app can read and write to the c:\mps\provdata directory. It seems as if it's not a permissions problem as the...
4
2107
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 Microsoft.DirectX.AudioVideoPlayback.Audio class for that purpose. My problem is whenever I send a command to the program windows gives an error related to the directX, and shuts down the program. However if I run the program manually after the startup it works just fine. I have...
2
1683
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 UI using my class, they get the usual "Control 'blah' accessed from a thread other than the thread it was created on.". I understand that of course, but my class is to be distributed to people who don't want to have to worry about invoking...
1
1737
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 seconds: Check to see if each of the other executables are running or not. If they are not running, it should load them. For this purpose, I am planning the following:
0
1784
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 same file? Here is my situation: I have an application that when launched does a check whether or not
0
9620
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10261
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10104
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.