.NET Framework Developer Center > .NET Development Forums > MSBuild > Resolving multiple APP.Config files
Ask a questionAsk a question
 

AnswerResolving multiple APP.Config files

  • Tuesday, November 03, 2009 5:32 AMAnilM_Nair Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    My solution has a couple of projects and i've included the configuration file (app.config) for both. While building the solution only the app.config of the start up project is copied to the /bin directory. But when i am executing the application it works fine. so why is it that the app.config of the class project not copied to the bin directory ? Please advice.

    Thanks

Answers

  • Wednesday, November 04, 2009 6:19 AMChao KuoMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hello, Nair
    Does the other project is a class library? The class library does not have config files, the share the configuration with the EXE files. You could make your dll have its own config files. Then you will have to run your dll in another AppDomain.
    For how to do this you could reference.
    Thanks
    Chao
    • Marked As Answer byAnilM_Nair Wednesday, November 04, 2009 10:43 AM
    •  

All Replies

  • Wednesday, November 04, 2009 6:19 AMChao KuoMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hello, Nair
    Does the other project is a class library? The class library does not have config files, the share the configuration with the EXE files. You could make your dll have its own config files. Then you will have to run your dll in another AppDomain.
    For how to do this you could reference.
    Thanks
    Chao
    • Marked As Answer byAnilM_Nair Wednesday, November 04, 2009 10:43 AM
    •  
  • Wednesday, November 04, 2009 9:14 AMAnilM_Nair Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Chao

    The other project is a class library. So i'll have to move all the key value pair of dll.config to exe.config.
    I just wanted to know if it's the right approach to have exe.config and dll.config in the output directory as a part of deployment ?

    Thanks,
    Anil
  • Wednesday, November 04, 2009 9:52 AMChao KuoMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello, Anil
    You don't need to put the dll.config in the output directory as a part of deployment. It is useless for you to put the dll.config to the output  directory. They share the same config file.
    If you want to use your own config, you have to create your own appDomain, and use the link I provided before.
    Thanks
    Chao