1

Im doing Unit tests for a big big project with so many things to test. My Project has 10 different modules.

Originally, I have my App.config where I have defined the path and the name of my ModuleConfiguration.xml and much more stuff... In this file, I have all the labels and values I use for these tests. Until now, all OK.

But My ModuleConfiguration is getting really really big, so I decide to split up and have one ConfigurationFile.xml for every module...

So for example:

  • ModemModule: ModemConfiguration.xml
  • HelperModule: HelperConfiguration.xml
  • and so on...

But then I would need one App.config for every different configurationFile as well...

So, my question is how I can use multiple App.config files in my proyect...

Thanks for the help in advance!

Tobias
  • 232
  • 1
  • 16
minoyo
  • 85
  • 1
  • 3
  • 14

1 Answers1

2

Split the modules up into their own projects, then Add As Link the "main" App.config file:

Sharing App.config across projects

  1. Right-click the project in Solution Explorer
  2. Choose Add -> Existing Item...
  3. Browse to the "main" project that contains the App.config you want to share with this project
  4. Click the filetype dropdown filter and choose All Files (*.*)
  5. Select the App.config
  6. Click the little arrow next to the Add button and choose Add As Link

I already added App.config as a link to Module01 in the screenshot. If you look closely, you'd notice the little shortcut overlay for Module01's App.config - that means that it's linked into the project from another project (in this case, the MyApplication project).

There are other ways to achieve what you want, but I believe this best fits your scenario.

Sameer Singh
  • 1,358
  • 1
  • 19
  • 47
  • Thanks Sammeer Singh, but spliting the modules into own proyects it is not possible... It´s just one single proyect. – minoyo Sep 06 '13 at 11:57
  • Hmmm, well maybe you should consider it, since you mentioned in your question that there are lots of things to test and they are modularized. – Sameer Singh Sep 06 '13 at 11:59
  • That being said, have a look at the links posted by @Tobias. They might help you find the best solution to your problem. – Sameer Singh Sep 06 '13 at 12:00