Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

TypeLoadException for Xunit.ClassDataTrribute using Xunit 2.1.0.3179
jpoehls
#1 Posted : Tuesday, October 27, 2015 5:35:34 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/3/2015(UTC)
Posts: 6
Location: United States of America

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)
Remco
#2 Posted : Tuesday, October 27, 2015 9:17:25 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
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.
jpoehls
#3 Posted : Tuesday, October 27, 2015 9:21:40 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 2/3/2015(UTC)
Posts: 6
Location: United States of America

Remco;7889 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
#4 Posted : Wednesday, October 28, 2015 5:51:38 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.033 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download