Thursday, May 28, 2009

Tip: Enterprise Library configuration setup in NUnit 2.5

While unit testing, I ran across the following error:

System.Configuration.ConfigurationErrorsException : The "cachingConfiguration" section is not available in the supplied configuration source.

I know that the Cache Configuration was defined correctly.Now, I began to wonder what was going on.  I was previously running my test using TestDriven.net, but then I switched to using the NUnit 2.5 user interface. After some digging, when I selected my project  in NUnit, it did not correctly setup my test information.

Steps for correctly making sure that your project test information get loaded.

  1. Load Project (the project to test) – This creates a .nunit test project which can be saved as a reference.
  2. Click Project –> Edit
     ProjectEditor1
  3. Check the following settings in General tab.
    1. Notice the following fields: Application Base & Config File Name
    2. Make sure that they are similar to the below diagram.

ProjectEditor2

0 comments: