EntLib Unit Tests hanging within Visual Studio

Topics: Building and extending application blocks, General discussion
Feb 16, 2009 at 7:35 PM

Hello,
When I run the EntLib 4.1 unit tests, Visual Studio 2008 almost always crashes. This happens regardless of whether or not the code is clean (unmodified) code or modified.

When VS crashes, sometimes I receive a Ok dialog saying "Exception has been thrown by the target of an invocation"... other times I just receive a "visual studio is closing" dialog with the typical Send Error Report button. I have also received other random errors such as "Screen compatible bitmap cannot be created. The screen bitmap format cannot be determined".

I am almost positive this is due to the large size of EnterpriseLibrary.Tests.sln combined with an environment issue relating to my machine's resources (though I have a decent laptop w/ 4 GB of RAM).

Has anyone run into this before, or have any ideas? I am looking into running the tests via MSTest.exe, but getting that together is becoming a pain (not to mention losing the IDE features).

Thanks,
Jason

Feb 17, 2009 at 3:38 AM
Have you read the documentation regarding the unit tests?  You can find it in Getting Started with Enterprise Library -> Contents of Enterprise Library -> Utilities, Tools, Quickstarts, and Guidance.  There are some pointers when running the unit tests there, check it out first.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com
Feb 17, 2009 at 1:06 PM
I did look there a bit... I happened to notice the name of the solution is outdated in the documentation :)   (it references the old EnterpriseLibrary.VSTS.sln file).

I mainly just wasn't sure if anyone else had troubleshooted this, or if I had missed any scripts for running the tests (similar to the scripts that do the builds).

Thanks,
Jason
Mar 3, 2009 at 7:59 AM
Answered in this post: http://entlib.codeplex.com/Thread/View.aspx?ThreadId=48978

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com
Mar 3, 2009 at 3:33 PM
Hello,
Thanks for the blog link. It gave me some ideas for directions to go. Unfortunately it talks about two different [and unrelated?] errors: the "Exception has been thrown by the target of an invocation" problem which I initially posted about, and an issue with assembly versioning. The article doesn't say much about whether or not they are related, but I believe they are not.

The main thing I found useful was unloading the Caching application block (the article's author unloaded the Caching, Data Access, and Cryptography blocks). To me, that seems to suggest an environmental issue relating to the volume of unit tests.

So, that appears to be my solution for now; not loading all the test projects at one time. I am also hoping to get this into an automated build environment, so hopefully I won't experience the issue there. If I do, I'm assuming that creating test lists to chunk out the tests may help. That would also help me locally too, but would rather use the IDE if I can.

Thanks,
Jason