VS2012上的Resharper 7忽略app.config中的程序集重定向

luk*_*fer 3 resharper mstest visual-studio-2012

我们使用最小起订量和AutoMoq与MSTEST,由于升级到VS2012和ReSharper的7,我们的测试与MSTEST运行正常,但无法使用的R#单元测试运行时:

Test method [...] threw exception: 
System.IO.FileLoadException: Could not load file or assembly 
'Moq, Version=3.1.416.3, Culture=neutral, PublicKeyToken=69f491c39445e920' 
or one of its dependencies. The located assembly's manifest definition does not 
match the assembly reference. (Exception from HRESULT: 0x80131040)
Run Code Online (Sandbox Code Playgroud)

AutoMoq是针对Moq 3.1.416.3构建的,我们使用4.0.10827.0,并在app.config中有一个程序集重定向.这在本地使用mstest和远程在TFS构建服务器上运行良好,但在使用R#单元测试运行器时则不行.

经过大量的搜索,我只在JetBrains论坛上找到了一个没有解决方案的线程,所以我也将问题提到了.

Kon*_*tin 6

mstest中存在一个已确认的错误,指出程序集重定向不起作用.有一个已知的解决方法:如果你有一个testsettings文件程序集重定向工作.我猜R#不会像mstest一样运行测试.我认为mstest现在实际上忽略了app.config,但这是我的推测.R#报告了一个问题:

http://youtrack.jetbrains.com/issue/RSRP-329567

这是他们确认错误的ms论坛帖子:

http://social.msdn.microsoft.com/Forums/en-US/vsunittest/thread/234926d1-42c0-4ebb-af39-1626e72f6c39

我希望我们可以投票支持在某处修复这个错误...

还有另一篇关于SO的帖子,同样的问题:

assemblybinding在mstest中不起作用