Print Page | Close Window

Unit Test throws exception

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=644
Printed Date: 11-Jun-2026 at 10:49am


Topic: Unit Test throws exception
Posted By: Customer
Subject: Unit Test throws exception
Date Posted: 03-Jan-2008 at 10:04am
While using Visual Studio 2008 and DevForce 3.5.5.1 Beta, I ran into an issue with ‘PersistenceManager.DefaultManager’ when I tried to run unit tests. If I run the application I get the correct value in the text box.  If I try to run the Unit Test “PersistanceManagerInUnitTests /DD.Tests.cs”, I get the following exception:  'PersistenceManager.DefaultManager' threw an exception of type 'IdeaBlade.Util.IdeaBladeException'.

base      {"Unable to obtain a valid configuration file on <ComputeName>\n\nProbing path: \n1) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\CQConverter.exe.config - not found\n2) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\devenv.exe.config - not found\n3) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\diffmerge.exe.config - not found\n4) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\MSTest.exe.config - not found\n5) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\TF.exe.config - not found\n6) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\TfsBuild.exe.config - not found\n7) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\TFSFieldMapping.exe.config - not found\n8) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\vsdiag_regwcf.exe.config - not found\n9) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\VSSConverter.exe.config - not found\n10) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\VSTestHost.exe.config - not found\n11) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\VSTST-FileConverter.exe.config - not found\n12) File: C:\\Program Files\\Microsoft Visual Studio 9.0\\Common7\\IDE\\IdeaBlade.ibconfig - not found\n13) Design-time execution detected - Will not probe for app.config or IdeaBlade.ibconfig in AppHelper\n14) IdeaBlade.ibconfig fallthru - Default IdeaBlade.ibconfig used\n15) Logging file: \n"}System.Exception {IdeaBlade.Util.IdeaBladeException}




Replies:
Posted By: IdeaBlade
Date Posted: 03-Jan-2008 at 10:07am
We ran into the very same issue when we started running our own Unit Tests on our V4 product (which runs only under VS2008).

Here’s the code we’re using – you’ll find an Initialize() method in all our V4 Unit Tests.

 

    [TestInitialize]

    public void Initialize() {

      // With the VS2008 Test framework the AppDomain and base directory will be pointing

      // to the common/ide directory and config file probing will fail if you're using the AppHelper. 

      // Here’s a workaround:

      IdeaBladeConfig.ConfigFileAssembly = System.Reflection.Assembly.Load("AppHelper");

    }

 

Note that the initialization isn’t strictly required in [TestInitialize], that’s just what we use.

 

 




Print Page | Close Window