在Resharper中运行NUnit单元测试时,出现以下错误:
SetUp method failed. SetUp : System.IO.FileNotFoundException : Could not
load file or assembly 'Microsoft.Practices.Unity, Version=2.0.414.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
The system cannot find the file specified.
如果然后我“重新运行失败的单元测试”,则它们将完成(尽管这可能需要多次重新运行)。似乎是因为我从v7升级到Resharper v8。
运行我们正在进行单元测试的多个应用程序中的任何一个都不会显示此错误。我们在整个代码中都使用ServiceLocator模式。
我似乎已在Resharper设置中修复了此问题,迫使每个程序集在运行测试时都拥有自己的AppDomain。请参阅Resharper-> Options-> Tools-> Unit Testing下的第三个复选框选项。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句