app.config

  • Thread starter Thread starter traversd
  • Start date Start date
T

traversd

Hi all.

I have a vb.net 2003 application that uses a config file. When i run
the application by double clicking on it it will read the settings from
the config file :)

but if i browse to it through run, or mor importantly call the exe from
another program it gets nothing from the config file.
The config file is in the same directory as the exe, i have tried
copying it to windows dir and to the dir of the calling app but is
always the same.

what do i need to do to sort this?
 
Hi,

I guess it might be using some command line parameters & you might be
invoking the app by clicking on shortcut (which has config file set as
the arguments to the exe)

Is this the case ?

To fix this, you might need to change the app to read the config file
(without the command line parameters)

HTH
Kalpesh
 
it is using cmd line parameters. it is being called from vba using
CreateProcessA(0&, cmdline$, 0&, 0&, 1&, _
NORMAL_PRIORITY_CLASS, 0&, 0&, Start, proc)

cmdline$ has the path and filename and parameters.
 
Hi,

If you have the source code of the vb.net app, you need to change the
way it reads the app.config

HTH
Kalpesh
 
Yes i have the source code, have only just ventured into config flies
though, what do i have to do to change the way it reads the file?
 
Yes i have the source code, have only just ventured into config flies
though, what do i have to do to change the way it reads the file?

Make sure that the .config file is named properly. When you run the
exe through the IDE this happens automtically.

The file should be named the same as your .exe with an additional
..config extension on it, including the ".exe". For example:
MyApp.exe.config

In your project, the file is named app.config and it gets automatically
renamed and copied to the bin folder when the project is compiled or
run.
 
Hi,

Post the "main" method code of your vb.net app. This is where you will
need to modify it to read from other file
What does your app.config look like ?

Kalpesh
 
The file was names properly. I have fised this now, ok so i have not
fixed it i have just created an xml file with all the settings in it :)
 

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

Back
Top