config file dosn't work when I deploy my app

  • Thread starter Thread starter ALI-R
  • Start date Start date
A

ALI-R

I have a config file in my app ,,called app.config.it works fine in debug
but when I deploy application it has no effect.Any suggestion??
Thanks for your help.

Here is my app.config
?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="defaultReportServer" value="myserver01" />
<add key="defaultDocLibrary" value="http://test/mytest" />
</appSettings>
</configuration>
 
app.config is a Visual Studio thing. VS.NET copies this file into the build directory (bin\debug for example) as <yourapp>.exe.config

The config file needs to have the same name as your .exe with ".config" on the end of it for the runtime to pick it up. So if your application is called winword.exe you need to call your config file winword.exe.config

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

I have a config file in my app ,,called app.config.it works fine in debug
but when I deploy application it has no effect.Any suggestion??
Thanks for your help.

Here is my app.config
?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="defaultReportServer" value="myserver01" />
<add key="defaultDocLibrary" value="http://test/mytest" />
</appSettings>
</configuration>
 
Thanks very much.it is now workin.
ALi
Richard Blewett said:
app.config is a Visual Studio thing. VS.NET copies this file into the
build directory (bin\debug for example) as said:
The config file needs to have the same name as your .exe with ".config"
on the end of it for the runtime to pick it up. So if your application is
called winword.exe you need to call your config file winword.exe.config
 
Back
Top