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

app.config

P: n/a
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?

Nov 21 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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

Nov 21 '05 #2

P: n/a
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.

Nov 21 '05 #3

P: n/a
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

Nov 21 '05 #4

P: n/a
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?

Nov 21 '05 #5

P: n/a

tr******@centatek.com wrote:
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.

Nov 21 '05 #6

P: n/a
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

Nov 21 '05 #7

P: n/a
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 :)

Nov 21 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.