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

Notification

Icon
Error

ERROR (Build): TEST_svcHMRMgr_Library: (0): System.NotImplementedException: GenericInst
CoolBreeze
#1 Posted : Thursday, August 8, 2019 4:06:21 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 7/11/2014(UTC)
Posts: 79
Location: United States of America

Was thanked: 9 time(s) in 9 post(s)
When I try to run tests in a VB class library with three of the tests using generics I get this error:

[11:24:27.1537-LocalBuildTask-32] ERROR (Build): TEST_svcHMRMgr_Library: (0): System.NotImplementedException: GenericInst
at _Mono.Cecil.SignatureReader.ReadPrimitiveValue(ElementType type)
at _Mono.Cecil.SignatureReader.ReadCustomAttributeElementValue(TypeReference type)
at _Mono.Cecil.SignatureReader.ReadCustomAttributeElement(TypeReference type)
at _Mono.Cecil.SignatureReader.ReadCustomAttributeElement(TypeReference type)
at _Mono.Cecil.SignatureReader.ReadCustomAttributeFixedArgument(TypeReference type)
at _Mono.Cecil.SignatureReader.ReadCustomAttributeConstructorArguments(CustomAttribute attribute, Collection`1 parameters)
at _Mono.Cecil.MetadataReader.ReadCustomAttributeSignature(CustomAttribute attribute)
at _Mono.Cecil.CustomAttribute.<Resolve>b__32_0(CustomAttribute attribute, MetadataReader reader)
at _Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
at _Mono.Cecil.CustomAttribute.Resolve()
at _Mono.Cecil.CustomAttribute.get_Fields()
at nCrunch.Compiler.CecilReflection.ILHashGenerator.HashCustomAttribute(FNV64& hash, CustomAttribute customAttribute)
at nCrunch.Compiler.CecilReflection.ILHashGenerator.(FNV64& , MethodDefinition )
at nCrunch.Compiler.CecilReflection.ILHashGenerator.HashMethod(MethodDefinition cecilMethod, Int32 stackSize)
at nCrunch.Compiler.CecilReflection.CecilMethod.get_Hash()
at nCrunch.TestExecution.Frameworks.DefaultClassMethodDescriptionLocator.(ReflectedType , ReflectedMethod , SequencePoint , Boolean , FNV64 )
at nCrunch.TestExecution.Frameworks.DefaultClassMethodDescriptionLocator.ExtractClassMemberDataFromType(ReflectedType type, Boolean hashAllMethods)
at nCrunch.Compiler.StaticManipulation.BuiltAssembly.(ReflectedAssembly , IDictionary`2 , TestFrameworkDescription[] , Boolean )
at nCrunch.Compiler.StaticManipulation.BuiltAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByFilePath, Boolean hashMethods)
at nCrunch.Compiler.RemoteBuildRunner..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters , FilePath , BuildOutput , DirectoryPath[] , FilePath[] )
at nCrunch.Compiler.RemoteBuildRunner..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Compiler.RemoteBuildRunner.(ComponentBuildParameters )

Based on the last term in the error message I see "GenericInst".

So I assume the problem is related to the use of generics.

When I exclude the three test files using generics from the project the build succeeds and I can run tests.

Also interesting:

Yesterday morning I successfully built and ran the tests using generics.

Yesterday afternoon I updated the code to be tested and the test code. No Go.

I'm now trying to narrow this down to a few lines of test code using generics.

After I posted the note I narrowed down the problem to:

<TestCase(ABC_LIB_Search_Criteria(Of String).Input_Format.CSV, "123456789012", {"123456789012"})>

NCrunch doesn't like the (Of String) in the test case. :(

I'll see if I can work around the problem.

NCrunch for Visual Studiuo 2017 3.23.0.10

I looked at all the release notes from builds 3.24 to 3.30. I didn't any notes about fixing bugs related to generics. I'll upgrade anyways and see what happens.
Remco
#2 Posted : Thursday, August 8, 2019 10:55:43 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 6,976

Thanks: 930 times
Was thanked: 1257 time(s) in 1170 post(s)
Hi, thanks for sharing this issue.

This problem is being triggered by an unexpected IL signature in the parameter of the attribute constructor call. Probably, it's specific to VB, which is why it's survived for so long and we haven't seen it before.

We're reworking all this code at the moment from the ground up. My preference would be to simply fix it with the rework. Have you been able to work around the problem in your code?
CoolBreeze
#3 Posted : Saturday, August 10, 2019 1:08:41 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 7/11/2014(UTC)
Posts: 79
Location: United States of America

Was thanked: 9 time(s) in 9 post(s)
Hi,

Yes, I worked around the problem like this:

<TestCase("CSV")>
<TestCase("Single_Line")>
Public Sub Test(Input_Format AS String)

Select Case Input_Format
Case "CSV"
' Do CSV test.

Case 'Single_Line"

End Select

End Sub

Not the most elegant but works for the time being.

Thanks for the answer.

FYI: I use NCrunch almost every workday. It's one of the most useful tools I use. So I really appreciate that you created it!
1 user thanked CoolBreeze for this useful post.
Remco on 8/10/2019(UTC)
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.042 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download