我有三个使用Xunit 2.3.0编写的测试,并且使用Moq 4.7.137(使用Castle.Core 4.2.0)模拟了一些服务。我的测试在我的本地工作区中正常工作,但在Team Foundation Server 2015中失败,并出现以下错误:
2017-10-10T08:20:44.7293310Z Information: [xUnit.net 00:00:22.8448542] System.AggregateException : One or more errors occurred. 2017-10-10T08:20:44.7293310Z Information: [xUnit.net 00:00:22.8457824] ---- System.MissingMethodException : Method not found: 'Boolean Castle.DynamicProxy.ProxyUtil.IsAccessible(System.Reflection.MethodBase, System.String ByRef)'. 2017-10-10T08:20:44.7293310Z Information: [xUnit.net 00:00:22.8466110] ---- The following constructor parameters did not have matching fixture data: LoanFixture fixture 2017-10-10T08:20:44.7449508Z Information: [xUnit.net 00:00:22.8598342] Stack Trace: 2017-10-10T08:20:44.7449508Z Information: [xUnit.net 00:00:22.8607783] 2017-10-10T08:20:44.7449508Z Information: [xUnit.net 00:00:22.8615987] ----- Inner Stack Trace #1 (System.MissingMethodException) ----- 2017-10-10T08:20:44.7449508Z Information: [xUnit.net 00:00:22.8624251] at Moq.Proxy.CastleProxyFactory.IsMethodVisible(MethodInfo method, String& messageIfNotVisible) 2017-10-10T08:20:44.7605671Z Information: [xUnit.net 00:00:22.8632101] C:\projects\moq4\Source\Mock.cs(811,0): at Moq.Mock.ThrowIfSetupMethodNotVisibleToProxyFactory(MethodInfo method) 2017-10-10T08:20:44.7605671Z Information: [xUnit.net 00:00:22.8640470] C:\projects\moq4\Source\Mock.cs(439,0): at Moq.Mock.<>c__DisplayClass62_0`1.<Setup>b__0() 2017-10-10T08:20:44.7605671Z Information: [xUnit.net 00:00:22.8648863] C:\projects\moq4\Source\PexProtector.cs(61,0): at Moq.PexProtector.Invoke[T](Func`1 function) 2017-10-10T08:20:44.7605671Z Information: [xUnit.net 00:00:22.8656833] C:\projects\moq4\Source\Mock.cs(432,0): at Moq.Mock.Setup[T](Mock`1 mock, Expression`1 expression, Condition condition) 2017-10-10T08:20:44.7605671Z Information: [xUnit.net 00:00:22.8664444] C:\projects\moq4\Source\Mock.Generic.cs(263,0): at Moq.Mock`1.Setup(Expression`1 expression) 2017-10-10T08:20:44.7605671Z Information: [xUnit.net 00:00:22.8672662] s\Banking\Banking.LoanManagement.Domain.Tests\Core\LoanFixture.cs(98,0): at Banking.LoanManagement.Domain.Tests.Core.LoanFixture.Initialize() 2017-10-10T08:20:44.7605671Z Information: [xUnit.net 00:00:22.8680978] s\Banking\Banking.LoanManagement.Domain.Tests\Core\LoanFixture.cs(36,0): at Banking.LoanManagement.Domain.Tests.Core.LoanFixture..ctor() 2017-10-10T08:20:44.7605671Z Information: [xUnit.net 00:00:22.8688788] ----- Inner Stack Trace #2 (Xunit.Sdk.TestClassException) ----- 2017-10-10T08:20:44.7605671Z Information: [xUnit.net 00:00:22.8696267]
我已经检查了所有相关的软件包。我还将tfs测试任务设置为测试运行程序。但是我解决不了
我有三个使用Xunit 2.3.0编写的测试,并且使用Moq 4.7.137(使用Castle.Core 4.2.0)模拟了一些服务。我的测试可以在我的本地工作区中正常工作,但是可以在Team Foundation Server中工作...
这是一个老问题,我忘了回答。在这种情况下,问题与先前版本中的specflow错误有关,然后已得到解决。