When I try to run tests that use Xunit's [ClassDataAttribute] I get this exception in NCrunch.
I'm using the xunit.core 2.1.0.3179 NuGet package and NCrunch 2.16.0.13 in Visual Studio 2015.
An error occurred while analysing this project after it was built: System.Exception: Exception during discovery:
System.TypeLoadException: Could not load type 'Xunit.ClassDataAttribute' from assembly 'xunit.core, Version=99.99.99.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c'.
at System.ModuleHandle.ResolveMethod(RuntimeModule module, Int32 methodToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount)
at System.ModuleHandle.ResolveMethodHandleInternalCore(RuntimeModule module, Int32 methodToken, IntPtr[] typeInstantiationContext, Int32 typeInstCount, IntPtr[] methodInstantiationContext, Int32 methodInstCount)
at System.ModuleHandle.ResolveMethodHandleInternal(RuntimeModule module, Int32 methodToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.CustomAttributeData..ctor(RuntimeModule scope, CustomAttributeRecord caRecord)
at System.Reflection.CustomAttributeData.GetCustomAttributes(RuntimeModule module, Int32 tkTarget)
at System.Reflection.CustomAttributeData.GetCustomAttributesInternal(RuntimeMethodInfo target)
at System.Reflection.RuntimeMethodInfo.GetCustomAttributesData()
at System.Reflection.MemberInfo.get_CustomAttributes()
at Xunit.Sdk.ReflectionMethodInfo.GetCustomAttributes(MethodInfo method, Type attributeType, AttributeUsageAttribute attributeUsage)
at Xunit.Sdk.ReflectionMethodInfo.GetCustomAttributes(MethodInfo method, String assemblyQualifiedAttributeTypeName)
at Xunit.Sdk.ReflectionMethodInfo.GetCustomAttributes(String assemblyQualifiedAttributeTypeName)
at ReflectionAbstractionExtensions.GetCustomAttributes(IMethodInfo methodInfo, Type attributeType)
at Xunit.Sdk.XunitTestFrameworkDiscoverer.FindTestsForMethod(ITestMethod testMethod, Boolean includeSourceInformation, IMessageBus messageBus, ITestFrameworkDiscoveryOptions discoveryOptions)
at Xunit.Sdk.XunitTestFrameworkDiscoverer.FindTestsForType(ITestClass testClass, Boolean includeSourceInformation, IMessageBus messageBus, ITestFrameworkDiscoveryOptions discoveryOptions)
at Xunit.Sdk.TestFrameworkDiscoverer.FindTestsForTypeAndWrapExceptions(ITestClass testClass, Boolean includeSourceInformation, IMessageBus messageBus, ITestFrameworkDiscoveryOptions discoveryOptions)
at nCrunch.Module.XUnit2.Integration.XUnit2TestFramework.FindFrameworkTestsInAssembly(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, ComponentUniqueName testComponentUniqueName)
at nCrunch.TestExecution.TestFinder.FindTestsForFrameworks(ReflectedAssembly assembly, FilePath assemblyFilePath, IList`1 referencedAssemblyFilePaths, TestFrameworkDescription[] frameworks, ComponentUniqueName testComponentUniqueName)
at nCrunch.TestExecution.RemoteTaskRunner.AnalyseAssembly(TestFrameworkDescription[] applicableFrameworks, ComponentUniqueName testComponentUniqueName)
Build/Test Issues
TypeLoadException for Xunit.ClassDataTrribute using Xunit 2.1.0.3179
Started by jpoehls on 5,675 views
Remco NCrunch Developer
#7889
27 Oct 2015 21:17 UTC
Hi, thanks for sharing this issue.
I think this is probably due to NCrunch not yet supporting Xunit 2.1 in v2.16.
v2.17 of NCrunch is due out soon, and it includes integration with Xunit 2.1.
Try downgrading to Xunit 2.0 to see if this resolves the issue.
I think this is probably due to NCrunch not yet supporting Xunit 2.1 in v2.16.
v2.17 of NCrunch is due out soon, and it includes integration with Xunit 2.1.
Try downgrading to Xunit 2.0 to see if this resolves the issue.
Remco wrote:Hi, thanks for sharing this issue.
I think this is probably due to NCrunch not yet supporting Xunit 2.1 in v2.16.
v2.17 of NCrunch is due out soon, and it includes integration with Xunit 2.1.
Try downgrading to Xunit 2.0 to see if this resolves the issue.
Cool, thanks. Ended up having to downgrade to Xunit 1.9.2 for other reasons and that fixed the problem.
Remco NCrunch Developer
#7891
28 Oct 2015 05:51 UTC
NCrunch v2.17 is out now, with Xunit 2.1 support - http://blog.ncrunch.net/post/NUnit-V3-Distributed-Processing-Upgrades-and-Lots-of-fixes.aspx.
Post a reply
Log in to reply.