app.config not copied to bin directory

G

Guest

Any help with this is greatly appreciated...

I have a solution where my startup project has an app.config file. But I
need it to be copied to the bin directory as <application>.dll.config. This
is not happening. I thought this was automatic. Is there something I am
missing?

Thanks in advance,

Rob
 
A

Andrew Backer

What are the build settings on the app config? Right click on it and
look. I think it needs to be something like 'copy always' or 'copy if
newer'. You may have it set to 'nothing'

- Andrew
 
J

Joseph Bittman MVP MCSD

Sept. 7, 2006

Hey Rob... I've seen this behavior if I made any change to the config
filename while I added it to the project.

When you add one, the default is "App.config"... just click OK.... I've
found, if you named it something else, then it won't be generated
automatically....

I sure would be interested, however, in hearing how I can specify VS to do
the same with non-default named app.configs......

--
Joseph Bittman
Microsoft Certified Solution Developer
Microsoft Most Valuable Professional -- DPM

Web Site/Blog: http://CactiDevelopers.ResDev.Net/
 
J

Jim Wooley

I have a solution where my startup project has an app.config file.
But I need it to be copied to the bin directory as
<application>.dll.config. This is not happening. I thought this was
automatic. Is there something I am missing?

Typically, the .config file is set for the .exe or web.config not for a class
library. What kind of application are you using where the config file would
be used directly from the library? I have seen this occur with nUnit projects.
In those cases, often you need to manually copy and rename the file to the
bin directory. I hope this helps.

Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
 
C

Chris Dunaway

Rob said:
I have a solution where my startup project has an app.config file. But I
need it to be copied to the bin directory as <application>.dll.config. This
is not happening. I thought this was automatic. Is there something I am
missing?

Is this a class library? If so then the App.config won't work with it.
You need to add your config data to the config file for the
application itself.
 

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