I stumbled across the same issue using ncrunch 4.2.0.7. Targeting .Net 4.6.2, AnyCPU, C# (7.3). I copied all C# files to a new solution with a new default C# .Net Framework Class Library project to show that it's not caused by a strange project file config or solution issue, and indeed ncrunch failed to build this project.
I found that by removing a property (that was causing a compiler warn) ncrunch successfully built the project. I then tried a few different ways of trying to make a reproducible case without my company's code involved, but it appears that it was nothing to do with the specific property, but rather something to do with the number of members/types in this project or overall, somehow, or something along those lines. I say this because I found that if I deleted other properties or other types in the project that seemed completely unrelated I would see a successful ncrunch build.
I should mention this is of course under Optimised Instrumentation, and setting it back to Default gives a successful build.
This was the (identical) exception
ERROR (Internal): System.IndexOutOfRangeException: Index was outside the bounds of the array.
at nCrunch.Compiler.Cil.Types.CilNestedClassTable..ctor(CilModule module, CilTableInfo tableInfo)
at nCrunch.Compiler.Cil.CilModule..ctor(CilAssembly assembly, CilMetadataRoot metadataRoot, CilPeHeaders peHeaders, CilContext context, DirectoryPath workingDirectory, UInt32 entryPointToken)
at nCrunch.Compiler.Cil.CilAssembly..ctor(Byte[] , CilContext , DirectoryPath )
at nCrunch.Compiler.Cil.CilAssembly.Load(FilePath assemblyFile, CilContext context)
at nCrunch.Compiler.Cil.CachedCilAssembly..ctor(FilePath assemblyFilePath, CilContext context, Boolean isInstrumentationTarget)
at nCrunch.Compiler.Cil.CilSession.LoadAssembly(FilePath assemblyFilePath, Boolean isInstrumentationTarget)
at nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly..ctor(FilePath builtAssemblyFilePath, IList`1 adjustedAssemblyReferences, Boolean instrumentForPerformanceMeasurement, ComponentInstrumentationParameters instrumentationParameters, ILogger logger)
at nCrunch.Compiler.RemoteBuildRunner..()
at nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
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, GridAddress clientAddress)
at nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
at nCrunch.Core.Processing.TaskLogic.ProcessTaskAndReturnSuccessFlag()
at nCrunch.Client.Processing.LocalProcessingTask.ProcessTaskAndReturnSuccessFlag()
at nCrunch.Client.Processing.ProcessingQueue..()
Let me know how to share more info, short of the full code, if there's a way.