Home All Groups Group Topic Archive Search About

app.config not copied to bin directory

Author
7 Sep 2006 3:25 PM
Rob
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

Author
7 Sep 2006 5:24 PM
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
Author
7 Sep 2006 5:39 PM
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/

Show quoteHide quote
"Rob" <R**@discussions.microsoft.com> wrote in message
news:91506CD9-5C7B-4E86-9A34-A54C7F1966AA@microsoft.com...
> 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
Author
8 Sep 2006 2:14 AM
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
Author
8 Sep 2006 1:14 PM
Chris Dunaway
Rob wrote:
> 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.