Relinq ExpressionTransformerRegistry/MSTest incompatibility (was: MSTest Error after upgrade to 3.1.0)

15 views
Skip to first unread message

Nicholas Blumhardt

unread,
Mar 28, 2011, 8:08:32 PM3/28/11
to nhibernate-development
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

Fabian Schmied

unread,
Mar 29, 2011, 5:38:52 AM3/29/11
to nhibernate-development
> Reported inhttp://groups.google.com/group/nhusers/browse_thread/thread/c7729f6d5...
>
> 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 inhttps://svn.re-motion.org/svn/Remotion/trunk/Relinq/Core/Parsing/Expr...)
>
> 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.

See "http://groups.google.com/group/re-motion-users/browse_thread/
thread/565a652b03682092".

Regards,
Fabian
Reply all
Reply to author
Forward
0 new messages