This post by Zulfiqar Ahmed about the ConfigurationErrorsException when using Visual Studio saved my day.
This error suddently appeared when debugging a test case in Visual Studio and I didn't realize that this had something to do with activating the breakpoint on common language runtime exceptions.