Build/Test Issues

Ncrunch cannot build my project

Started by BrilliantSkies on 1,555 views

Hello,

Error reads:


NCrunch has encountered an internal error: System.Exception: System.Exception: Unable to instrument type BrilliantSkies.Core.Maths.CircShift due to exception: System.Exception: Unable to instrument method !!0[,] BrilliantSkies.Core.Maths.CircShift::CircularShift(!!0[,], System.Int32, System.Int32) due to exception: System.InvalidOperationException: Nullable object must have a value.
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
at nCrunch.Compiler.Cil.Types.CilTypeSignature.ResolveGenericArgumentsIntoNewSignature(CilExpandableBuffer signatureBuffer, Nullable`1 typeInstantiation, Nullable`1 methodInstantiation)
at nCrunch.Compiler.StaticManipulation.InstrumentationConcerns.LoggedDataValueResolvedSignature.(MethodInstrumentationContext , CilTypeSignature , Nullable`1 , Nullable`1 )
at nCrunch.Compiler.StaticManipulation.InstrumentationConcerns.LoggedDataValueResolvedSignature..ctor(MethodInstrumentationContext context, CilModule module, CilTypeSignature typeSignature, Nullable`1 contextualType, Nullable`1 contextualMethod)
at nCrunch.Compiler.StaticManipulation.InstrumentationConcerns.RdiInstrumentationConcern.(CilMetadataToken , Code )
at nCrunch.Compiler.StaticManipulation.InstrumentationConcerns.RdiInstrumentationConcern.InstrumentCurrentInstruction()
at nCrunch.Compiler.StaticManipulation.InstrumentationConcerns.TryFinallyInstrumentationConcern.InstrumentCurrentInstruction()
at nCrunch.Compiler.StaticManipulation.BuiltCilAssembly.(CilManipulationOperation , CilMethodDefinition , CilTypeDefinition , CilMethodBody , Boolean )
at nCrunch.Compiler.StaticManipulation.BuiltCilAssembly.(CilTypeDefinition , CilManipulationOperation , IInstrumentationFilter[] )
at nCrunch.Compiler.StaticManipulation.BuiltCilAssembly.(CilTypeDefinition , CilManipulationOperation , IInstrumentationFilter[] )
at nCrunch.Compiler.StaticManipulation.BuiltCilAssembly..()
at nCrunch.Compiler.StaticManipulation.BuiltCilAssembly..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Compiler.StaticManipulation.BuiltCilAssembly..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
at nCrunch.Compiler.StaticManipulation.BuiltCilAssembly.Instrument(IInstrumentationFilter[] instrumentationFilters, PerfTracker perfTracker)
at nCrunch.Compiler.CilProcessingTasks.CilInstrumentationTask.ProcessTask(IBuiltAssembly builtAssembly, ComponentInstrumentationParameters instrumentationParameters, BuildOutput output)
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)


If I remove this function it will continue to error on all sorts of other issues such as generic function calls. A few years ago I used Ncrunch very successfully, now it cannot build my most basic DLL. Any ideas?
It's a DLL for a unity game that references a bunch of unityengine modules and obviously builds fine in visual studio 2022.
Hi, thanks for sharing this issue.

This looks to be an IL sequence that we aren't handling right. Are you able to isolate this problem in a code sample that you can share with me? If I can reproduce the sequence on my side, I should hopefully be able to get you a prompt fix.

It may be possible to work around this problem by disabling RDI (set 'Enable RDI' to 'False'), or by placing RDI suppression comments around the code involved, for example:


    //ncrunch: rdi off
    public void ThisMethodHasRdiDisabled()
    {
        Console.WriteLine("No RDI data collection");
    }
    //ncrunch: rdi default

Post a reply

Log in to reply.