Build/Test Issues

Build failed on [DataRow(null)]

Started by TimVisma on 1,562 views

Hello,

I am using Rider 2024.1.2 with NCrunch 5.8.0.2 and I got the following error:

NCrunch has encountered an internal error: System.Exception: Unsupported DataRowAttribute argument type. NCrunch does not support this version of MSTest under StaticAnalysis. Please report this problem and switch to DynamicAnalysis to use NCrunch with this assembly
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)


The issue is related to the test attribute: [DataRow(null)]. When I comment it out, both the build and tests pass successfully.

Greetz,

Tim
Hi Tim,

Thanks for sharing this issue.

When using NCrunch with MSTest under Static Analysis, NCrunch doesn't support working with DataRow tests that use reference types as parameters. This is a technical limitation caused by the difficulty in uniquely identifying and transferring such types from a static environment (where there are no runtime types) to a dynamic one (where the test is run).

If you need tests to be expressed this way, I recommend changing your Framework Utilisation Type for MSTest to 'DynamicAnalysis'. This will resolve the issue for you.
Hi Remco,

Thanks for the response. When I am using DynamicAnalysis, the build will then succeed and so will the tests themselves.

Greetz,

Tim

Post a reply

Log in to reply.