strang, isn't it?

G

Guest

Hello
I have (strange for me) problem. I have developed an application , let's say
MyApp.exe. This is win-forms application. It has its own configuration file,
generated of course by VS.NET and called MyApp.exe.config.
I put a path to this application into registry, that the app starts when
windows will start. A problem is that I have an error when the app starts -
..exe.config could not be found. But If I start this app manually everythig
works fine
What could be a problem? Maybe I should modify the registry entry and pass
the config file as a parameter?
Thanks for any suggestions
Damar
 
N

Nick Malik [Microsoft]

Please post the complete text of the error message.

I assume that this is a console application, since you are starting it when
Windows starts. Did you create this as a service?

If not, first answer "why not?" so I can understand your constraints and
then please tell me the location in the registry that you are using to
denote you want the app to start on start-up (so I can repro the problem.
There's more than one registry setting that can be used like this).

If possible, can you post a small but complete app that recreates this
problem?

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
G

Guest

Hello


Here is the error message :
"An unhandled exception has occured in your application..... .Config file
APP.exe.config cannot be read successfully due to exception:
System.IO.FileNotFoundException..."

But it is only if I start this app not "manually" ,here is the code:

Process myProcess = new Process();
myProcess.StartInfo.FileName="C:\\App.exe";
myProcess.Start();

If I start it from explorer everything is all right. So what am I doing
wrong here?
Damar
 
N

Nick Malik [Microsoft]

You may want to set the working directory in the start info structure, and
set UseShellExecute to Off.



--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top