Search code examples
c#referenceconfigsolutionclass-library

When you reference library how to copy to TargetDir not only .dll but also .config


I have an additional config file for my library. I use it to config log4net. So library can configure log4net. I add reference to the library to another project in my solution and i need to make VS copy not only .dll file, but also .config file. How can i do it? Thanks.


Solution

  • As Micky pointed out assemblies don't have config files, but you could use "Add existing file" and select "Add as Link" and then set "Copy To Output Directory" To "Copy always" this way the file should be copied to the output directory.