Hi, im getting this error when running tests on code with generic attributes
Code:
Quote:
using Microsoft.VisualStudio.TestTools.UnitTesting;
[MyAttribute<MyEnum>(MyEnum.One)]
public class Code
{
}
public class MyAttribute<T> : Attribute where T : Enum
{
public MyAttribute(T value)
{
}
}
public enum MyEnum
{
One
}
[TestClass]
public class CodeTests
{
[TestMethod]
public void Test()
{
var code = new Code();
}
}
Full error:
NCrunch has encountered an internal error: System.Exception: nCrunch.Compiler.StaticManipulation.CilTypeHashException: Unable to hash type 'Code' due to exception: System.NotSupportedException: Unknown element type: Var
at nCrunch.Compiler.Cil.CustomAttributes.CilAttributeArgument.get_SizeInBytes()
at nCrunch.Compiler.Cil.CustomAttributes.CilCustomAttributeValue.get_NamedArguments()
at nCrunch.Compiler.StaticManipulation.CilMethodHashGenerator.HashCustomAttribute(FNV64& hash, CilCustomAttribute customAttribute)
at nCrunch.Compiler.StaticManipulation.CilMethodHashGenerator.HashType(FNV64& hash, CilTypeDefinition type)
at nCrunch.Compiler.StaticManipulation.BuiltCilAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByForegroundFilePath, Boolean storeImpactHashes)
at nCrunch.Compiler.StaticManipulation.BuiltCilAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByForegroundFilePath, Boolean storeImpactHashes)
at nCrunch.Compiler.CilProcessingTasks.CilMethodHashingTask..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Compiler.CilProcessingTasks.ConcurrentCilTaskProcessor.()
at nCrunch.Compiler.CilProcessingTasks.ConcurrentCilTaskProcessor.ProcessTasks(Int32 backgroundThreadsAllowed)
at nCrunch.Compiler.RemoteBuildRunner.(ComponentInstrumentationParameters , BuildOutput , IBackgroundTaskProcessor )
at nCrunch.Compiler.RemoteBuildRunner.PerformPostProcessingOfBuiltAssembly(ComponentInstrumentationParameters instrumentationParameters, BuildOutput output, IBackgroundTaskProcessor backgroundTaskProcessor)
at nCrunch.Core.BuildManagement.BuildEnvironment..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Core.BuildManagement.BuildEnvironment.Build(SnapshotComponent snapshotComponentToBuild, IList`1 referencedComponents, GridClientId gridClientId, IList`1 customEnvironmentVariables, IPlatformBuildExtender extender, Guid taskId, GridClientDescription clientDescription, Boolean extractCoverageReportStructure)