Reported in
http://groups.google.com/group/nhusers/browse_thread/thread/c7729f6d56dc022f
Between 3.0 and 3.1, Relinq was updated to support medium trust. The
ExpressionTransformerRegistry.CreateDefault() method now uses:
GetReferencedAssemblies().Where(a => a.Name ==
"mscorlib").Single()
to get the mscorlib version (see comments in
https://svn.re-motion.org/svn/Remotion/trunk/Relinq/Core/Parsing/ExpressionTreeVisitors/Transformation/ExpressionTransformerRegistry.cs)
Under MSTest in VS2010 two mscorlibs appear in the list, so the
Single() call throws during the static constructor for
NhRelinqQueryParser. This makes NHibernate-based tests fail in MSTest.
The problem is intermittent to some degree - on occasion the
initialisation completes successfully. Test runners other than the
Microsoft one (e.g. Gallio, ReSharper) can successfullly run the
tests.
No extra info to share on this - probably one for Re-Motion to look
into. We've been able to get around it by replacing Single() with
First() in the line shown above.
Cheers,
Nick