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

Notification

Icon
Error

2 Pages12>
NCrunch 4 - Instrumentation Mode - Optimized - Project fails to build
UppSol
#1 Posted : Thursday, November 7, 2019 2:48:13 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 3/21/2019(UTC)
Posts: 41
Location: Austria

Thanks: 30 times
Was thanked: 7 time(s) in 7 post(s)
Hi,
I already submitted an issue via VS directly, after updating to NCrunch v4 (all cashes are cleared, vs restarted multiple times) one project fails to build (switching back to Default/Legacy Instrumentation Mode makes NCrunch working again).

BTW: We are using sdk-based project files with .NET 4.7.2.

Here is the source code that seems to break NCrunch (inkl. the Interface):

public interface IIdGenerationRepository<TIdItem> where TIdItem : class, IIdItem
{
#region Public Methods

[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
Task<int> GetNextIdAsync();

#endregion
}


public class IdGenerationRepository<TIdItem> : IIdGenerationRepository<TIdItem>
where TIdItem : class, IIdItem
{
#region Private Fields

//Hier wird immer 1 genommen, da die Implementierung vom _repository.Create eine Id verlangt.
//Diese wird nicht gespeichert und auch nicht in der Implementierung verwendet.
private const string Id = "1";

private readonly IRepository<TIdItem> _repository;

#endregion

#region Initialization

public IdGenerationRepository(IRepository<TIdItem> repository)
{
_repository = repository;
}

#endregion

#region Interface Implementation: IIdGenerationRepository<TIdItem>

public async Task<int> GetNextIdAsync()
{
TIdItem idItemEF = _repository.Create(Id);

await _repository.SaveAsync(idItemEF);

return idItemEF.ConsecutiveNumber;
}

#endregion
}


[15:37:20.8093-LocalBuildTask-79] ERROR (Internal): nCrunch.Compiler.NewStaticManipulation.CilTypeHashException: Unable to hash type 'Upper.DistributionManager.Data.IdGenerationRepository`1' due to exception: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at nCrunch.Compiler.Cil.Types.CilTypeDefTable.GetRowByMethodDefIndex(UInt32 methodDefTableRowIndex)
at nCrunch.Compiler.Cil.Methods.CilMethodDefinition.TryResolveASyncTarget()
at nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.(Boolean , ClassMethodData , Dictionary`2 , CilTypeDefinition , FNV64& , CilMethodDefinition )
at nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByForegroundFilePath, Boolean storeImpactHashes)
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, 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..()

Please let me know if I can help to fix the issue.

br
Renè
1 user thanked UppSol for this useful post.
michaelkroes on 11/7/2019(UTC)
michaelkroes
#2 Posted : Thursday, November 7, 2019 3:12:58 PM(UTC)
Rank: NCrunch Developer

Groups: Registered
Joined: 9/22/2017(UTC)
Posts: 306
Location: Netherlands

Thanks: 138 times
Was thanked: 73 time(s) in 69 post(s)
Hi!

Thanks for taking the time to report the issue in such great detail. We will have a look and report back to you.

Michael
1 user thanked michaelkroes for this useful post.
UppSol on 11/7/2019(UTC)
MatthewSteeples
#3 Posted : Thursday, November 7, 2019 3:16:38 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 139
Location: United Kingdom

Thanks: 7 times
Was thanked: 18 time(s) in 16 post(s)
We get the same error (obviously for a different class!). Have also submitted a bug report
1 user thanked MatthewSteeples for this useful post.
UppSol on 11/7/2019(UTC)
Remco
#4 Posted : Friday, November 8, 2019 12:43:07 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
1 user thanked Remco for this useful post.
VNicholson on 11/8/2019(UTC)
VNicholson
#6 Posted : Friday, November 8, 2019 1:25:23 AM(UTC)
Rank: Member

Groups: Registered
Joined: 12/19/2013(UTC)
Posts: 25
Location: New Zealand

Thanks: 6 times
Was thanked: 3 time(s) in 3 post(s)
I'm not OP but I could consistently reproduce this problem with 4.0.0.2. Upgrading to 4.0.0.3 has resolved the issue for me.
1 user thanked VNicholson for this useful post.
Remco on 11/8/2019(UTC)
UppSol
#5 Posted : Friday, November 8, 2019 5:59:54 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 3/21/2019(UTC)
Posts: 41
Location: Austria

Thanks: 30 times
Was thanked: 7 time(s) in 7 post(s)
1 user thanked UppSol for this useful post.
Remco on 11/8/2019(UTC)
MatthewSteeples
#7 Posted : Friday, November 8, 2019 8:30:45 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 10/28/2014(UTC)
Posts: 139
Location: United Kingdom

Thanks: 7 times
Was thanked: 18 time(s) in 16 post(s)
Fixes it for us too. Thanks
jesuissur
#8 Posted : Friday, November 8, 2019 1:48:25 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/5/2012(UTC)
Posts: 4
Location: Canada

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
We've installed the 4.1.0.1 version and still got the problem.
The processing queue display this error for one of our project (.Net Core app 2.2) using the new Optimized instrumentation

[08:43:37.3733-LocalBuildTask-29] ERROR (Internal): nCrunch.Compiler.NewStaticManipulation.CilTypeHashException: Unable to hash type 'ABC.DEF' due to exception: nCrunch.Compiler.Cil.Types.CilResolutionFailedException: The expected type with identifier '9234630561816887799' was not found in this assembly
at nCrunch.Compiler.Cil.Types.CilExportedTypeTable.GetTypeById(UInt64 typeId)
at nCrunch.Compiler.Cil.Types.CilTypeDefTable.GetTypeById(UInt64 typeId)
at nCrunch.Compiler.Cil.Types.CilExportedTypeTable.GetTypeById(UInt64 typeId)
at nCrunch.Compiler.Cil.Types.CilTypeDefTable.GetTypeById(UInt64 typeId)
at nCrunch.Compiler.Cil.Types.CilTypeDefinition.ResolveBaseType()
at nCrunch.Compiler.Cil.Methods.CilMethodsWithInheritanceEnumerator.MoveNext()
at nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByForegroundFilePath, Boolean storeImpactHashes)
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, 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..()

Silvenga
#10 Posted : Friday, November 8, 2019 3:14:29 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 1/24/2016(UTC)
Posts: 40
Location: United States of America

Was thanked: 3 time(s) in 3 post(s)
Also have a problem on 4.1.0.1 with optimized builds enabled. Bug report submitted.

Code:

System.NullReferenceException: Object reference not set to an instance of an object.
   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, 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..()
wilhelmmedetz
#11 Posted : Friday, November 8, 2019 5:20:29 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 7/4/2012(UTC)
Posts: 35

Was thanked: 2 time(s) in 2 post(s)
Also getting a Null reference exception - NCrunch 4.1.0.1

[18:13:30.3805-LocalBuildTask-24] ERROR: System.InvalidOperationException: Das Objekt mit Nullwert muss einen Wert haben.
bei System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
bei nCrunch.Compiler.NewStaticManipulation.InstrumentationConcerns.PerformanceTrackingInstrumentationConcern.CompleteMethodInstrumentation()
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.(CilManipulationOperation , CilMethodDefinition , CilTypeDefinition , CilMethodBody , Boolean )
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.(CilTypeDefinition , InstrumentationOutput , CilManipulationOperation , IInstrumentationFilter[] )
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly..()
bei nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly..()
bei nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.Instrument(IInstrumentationFilter[] instrumentationFilters, PerfTracker perfTracker)
bei nCrunch.Compiler.CilProcessingTasks.CilInstrumentationTask.ProcessTask(IBuiltAssembly builtAssembly, ComponentInstrumentationParameters instrumentationParameters, BuildOutput output)
bei nCrunch.Compiler.CilProcessingTasks.ConcurrentCilTaskProcessor.()
[18:13:30.3826-LocalBuildTask-24] ERROR (Internal): System.InvalidOperationException: Das Objekt mit Nullwert muss einen Wert haben.
bei nCrunch.Compiler.CilProcessingTasks.ConcurrentCilTaskProcessor.ProcessTasks(Int32 backgroundThreadsAllowed)
bei nCrunch.Compiler.RemoteBuildRunner.(ComponentInstrumentationParameters , BuildOutput , IBackgroundTaskProcessor )
bei nCrunch.Compiler.RemoteBuildRunner.PerformPostProcessingOfBuiltAssembly(ComponentInstrumentationParameters instrumentationParameters, BuildOutput output, IBackgroundTaskProcessor backgroundTaskProcessor)
bei nCrunch.Core.BuildManagement.BuildEnvironment..()
bei nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
bei nCrunch.Core.BuildManagement.BuildEnvironment.Build(SnapshotComponent snapshotComponentToBuild, IList`1 referencedComponents, GridClientId gridClientId, IList`1 customEnvironmentVariables, IPlatformBuildExtender extender, Guid taskId, GridAddress clientAddress)
bei nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
bei nCrunch.Core.Processing.TaskLogic.ProcessTaskAndReturnSuccessFlag()
bei nCrunch.Client.Processing.LocalProcessingTask.ProcessTaskAndReturnSuccessFlag()
bei nCrunch.Client.Processing.ProcessingQueue..()

Submitted a bug report.

Solution can be found at
https://github.com/SimControl/SimControl.Reactive
Remco
#12 Posted : Friday, November 8, 2019 10:55:34 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks everyone for these stacktraces. I'm building a list of issues with the new optimised mode right now with a plan to work through these early in the coming week. If you experience any other exceptions that aren't shown here, please do share them so we can get them fixed quickly.

I'll let you know as soon as we can make a new build available with fixes. Switching back to legacy mode should be an effective workaround for now. Note that under advanced configuration, you should be able to do this on a per-project basis.
1 user thanked Remco for this useful post.
jesuissur on 11/10/2019(UTC)
Remco
#13 Posted : Tuesday, November 12, 2019 12:59:25 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
2 users thanked Remco for this useful post.
UppSol on 11/12/2019(UTC), richardmoss on 11/13/2019(UTC)
wilhelmmedetz
#14 Posted : Tuesday, November 12, 2019 9:26:20 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 7/4/2012(UTC)
Posts: 35

Was thanked: 2 time(s) in 2 post(s)
Tried NCrunch_VS2019_4.2.0.1.msi

Still getting a build error.
Submitted bug report.
Solution can be found at
https://github.com/SimControl/SimControl.Reactive

[10:02:49.2611-LocalBuildTask-37] ERROR: System.Exception: Unable to instrument type SimControl.Templates.CSharp.OldClassLibrary.Class1 due to exception: System.Exception: Unable to instrument method System.Void SimControl.Templates.CSharp.OldClassLibrary.Class1::.ctor() due to exception: System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei nCrunch.Compiler.Cil.Utility.CilAddress.ReadCompressedUInt32AndAdvance()
bei nCrunch.Compiler.Cil.Symbols.Portable.CilPortableSequencePointEnumerator..ctor(CilAddress blobAddress, UInt32 documentRowIndex)
bei nCrunch.Compiler.Cil.Symbols.Portable.CilPortableSequencePointIndex.TryIndexMethodSequencePoints(CilMethodBody methodBody, UInt32 methodTableRowIndex)
bei nCrunch.Compiler.Cil.Methods.CilMethodDefinition.IndexSequencePoints(ICilSequencePointIndex index)
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.(CilManipulationOperation , CilMethodDefinition , CilTypeDefinition , CilMethodBody , Boolean )
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.(CilTypeDefinition , InstrumentationOutput , CilManipulationOperation , IInstrumentationFilter[] )
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.(CilTypeDefinition , InstrumentationOutput , CilManipulationOperation , IInstrumentationFilter[] )
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly..()
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly..()
bei nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly..()
bei nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.Instrument(IInstrumentationFilter[] instrumentationFilters, PerfTracker perfTracker)
bei nCrunch.Compiler.CilProcessingTasks.CilInstrumentationTask.ProcessTask(IBuiltAssembly builtAssembly, ComponentInstrumentationParameters instrumentationParameters, BuildOutput output)
bei nCrunch.Compiler.CilProcessingTasks.ConcurrentCilTaskProcessor.()
[10:02:49.2611-LocalBuildTask-37] ERROR: nCrunch.Compiler.NewStaticManipulation.CilTypeHashException: Unable to hash type 'SimControl.Templates.CSharp.OldClassLibrary.Class1' due to exception: System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei nCrunch.Compiler.Cil.Utility.CilAddress.ReadCompressedUInt32AndAdvance()
bei nCrunch.Compiler.Cil.Symbols.Portable.CilPortableSequencePointEnumerator..ctor(CilAddress blobAddress, UInt32 documentRowIndex)
bei nCrunch.Compiler.Cil.Symbols.Portable.CilPortableSequencePointHandler.GetFirstRelevantSequencePoint(CilMethodBody methodBody, UInt32 methodTableRowIndex)
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.(Boolean , ClassMethodData , Dictionary`2 , CilTypeDefinition , FNV64& , CilMethodDefinition )
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByForegroundFilePath, Boolean storeImpactHashes)
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByForegroundFilePath, Boolean storeImpactHashes)
bei nCrunch.Compiler.CilProcessingTasks.CilMethodHashingTask..()
bei nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
bei nCrunch.Compiler.CilProcessingTasks.ConcurrentCilTaskProcessor.()
[10:02:49.2813-LocalBuildTask-37] ERROR (Internal): System.Exception: nCrunch.Compiler.NewStaticManipulation.CilTypeHashException: Unable to hash type 'SimControl.Templates.CSharp.OldClassLibrary.Class1' due to exception: System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei nCrunch.Compiler.Cil.Utility.CilAddress.ReadCompressedUInt32AndAdvance()
bei nCrunch.Compiler.Cil.Symbols.Portable.CilPortableSequencePointEnumerator..ctor(CilAddress blobAddress, UInt32 documentRowIndex)
bei nCrunch.Compiler.Cil.Symbols.Portable.CilPortableSequencePointHandler.GetFirstRelevantSequencePoint(CilMethodBody methodBody, UInt32 methodTableRowIndex)
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.(Boolean , ClassMethodData , Dictionary`2 , CilTypeDefinition , FNV64& , CilMethodDefinition )
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByForegroundFilePath, Boolean storeImpactHashes)
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByForegroundFilePath, Boolean storeImpactHashes)
bei nCrunch.Compiler.CilProcessingTasks.CilMethodHashingTask..()
bei nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
bei nCrunch.Compiler.CilProcessingTasks.ConcurrentCilTaskProcessor.()
bei nCrunch.Compiler.CilProcessingTasks.ConcurrentCilTaskProcessor.ProcessTasks(Int32 backgroundThreadsAllowed)
bei nCrunch.Compiler.RemoteBuildRunner.(ComponentInstrumentationParameters , BuildOutput , IBackgroundTaskProcessor )
bei nCrunch.Compiler.RemoteBuildRunner.PerformPostProcessingOfBuiltAssembly(ComponentInstrumentationParameters instrumentationParameters, BuildOutput output, IBackgroundTaskProcessor backgroundTaskProcessor)
bei nCrunch.Core.BuildManagement.BuildEnvironment..()
bei nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
bei nCrunch.Core.BuildManagement.BuildEnvironment.Build(SnapshotComponent snapshotComponentToBuild, IList`1 referencedComponents, GridClientId gridClientId, IList`1 customEnvironmentVariables, IPlatformBuildExtender extender, Guid taskId, GridAddress clientAddress)
bei nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag()
bei nCrunch.Core.Processing.TaskLogic.ProcessTaskAndReturnSuccessFlag()
bei nCrunch.Client.Processing.LocalProcessingTask.ProcessTaskAndReturnSuccessFlag()
bei nCrunch.Client.Processing.ProcessingQueue..()
spolonski
#16 Posted : Tuesday, November 12, 2019 9:44:32 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 7/11/2016(UTC)
Posts: 32
Location: Germany

Thanks: 6 times
Was thanked: 4 time(s) in 4 post(s)
NCrunch_VS2019_4.2.0.1.msi fixed my Issue:

[09:51:27.1838-CIL Task Processor-30] ERROR: System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
bei nCrunch.Compiler.NewStaticManipulation.InstrumentationConcerns.PrimaryInstrumentationConcern.InstrumentCurrentInstruction()
bei nCrunch.Compiler.NewStaticManipulation.InstrumentationConcerns.PerformanceTrackingInstrumentationConcern.InstrumentCurrentInstruction()
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.(CilManipulationOperation , CilMethodDefinition , CilTypeDefinition , CilMethodBody , Boolean )
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.(CilTypeDefinition , InstrumentationOutput , CilManipulationOperation , IInstrumentationFilter[] )
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly..()
bei nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly..()
bei nCrunch.Common.PerformanceTracking.PerfTracker.TrackActivity(String name, Action activity)
bei nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.Instrument(IInstrumentationFilter[] instrumentationFilters, PerfTracker perfTracker)
bei nCrunch.Compiler.CilProcessingTasks.CilInstrumentationTask.ProcessTask(IBuiltAssembly builtAssembly, ComponentInstrumentationParameters instrumentationParameters, BuildOutput output)
bei nCrunch.Compiler.CilProcessingTasks.ConcurrentCilTaskProcessor.()

1 user thanked spolonski for this useful post.
Remco on 11/12/2019(UTC)
Remco
#15 Posted : Tuesday, November 12, 2019 10:01:09 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
wilhelmmedetz;14054 wrote:
Tried NCrunch_VS2019_4.2.0.1.msi

Still getting a build error.
Submitted bug report.
Solution can be found at
https://github.com/SimControl/SimControl.Reactive


Thanks for sharing this.

I think the reason we're seeing problems with this solution is because of the IL weaver(s) used by the logging. This weavers are not necessarily in error, but they do result in a different assembly structure to what we've been testing with.

I've tried to do some testing with the solution myself, but I can't seem to get it to build in VS. Is there any guidance available for building the solution on a fresh checkout? Or is there any chance you might be able to provide me with some pre-built binaries to perform testing with?
jesuissur
#9 Posted : Tuesday, November 12, 2019 1:00:15 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/5/2012(UTC)
Posts: 4
Location: Canada

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Works fine now with the 4.2.0.1 version

Thanks guys

jesuissur;14037 wrote:
We've installed the 4.1.0.1 version and still got the problem.
The processing queue display this error for one of our project (.Net Core app 2.2) using the new Optimized instrumentation

[08:43:37.3733-LocalBuildTask-29] ERROR (Internal): nCrunch.Compiler.NewStaticManipulation.CilTypeHashException: Unable to hash type 'ABC.DEF' due to exception: nCrunch.Compiler.Cil.Types.CilResolutionFailedException: The expected type with identifier '9234630561816887799' was not found in this assembly
at nCrunch.Compiler.Cil.Types.CilExportedTypeTable.GetTypeById(UInt64 typeId)
at nCrunch.Compiler.Cil.Types.CilTypeDefTable.GetTypeById(UInt64 typeId)
at nCrunch.Compiler.Cil.Types.CilExportedTypeTable.GetTypeById(UInt64 typeId)
at nCrunch.Compiler.Cil.Types.CilTypeDefTable.GetTypeById(UInt64 typeId)
at nCrunch.Compiler.Cil.Types.CilTypeDefinition.ResolveBaseType()
at nCrunch.Compiler.Cil.Methods.CilMethodsWithInheritanceEnumerator.MoveNext()
at nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByForegroundFilePath, Boolean storeImpactHashes)
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, 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..()


1 user thanked jesuissur for this useful post.
Remco on 11/12/2019(UTC)
richardmoss
#17 Posted : Wednesday, November 13, 2019 6:11:14 PM(UTC)
Rank: Member

Groups: Registered
Joined: 9/1/2012(UTC)
Posts: 12

Thanks: 3 times
Was thanked: 4 time(s) in 4 post(s)
Hello,

Can also confirm that the 4.2 build linked above seems to have resolved the "1 project failed to build" issue I was having with multiple classic .NET Framework solutions.

Thanks!
1 user thanked richardmoss for this useful post.
Remco on 11/13/2019(UTC)
mkoertgen
#18 Posted : Tuesday, April 7, 2020 10:50:52 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/16/2016(UTC)
Posts: 5
Location: Germany

Thanks: 1 times
Hi all,

I am probably facing a related issue, where NCrunch never comes to rest with constantly failing to build one specific test project in a solution.

Using NCrunch 4.0.13 (2/2020) i also hit the "Unable to hash type"-exception with the "Optimized"-Instrumentation mode. As a workaround i can set it back to "Legacy".

Here is the output from the "Processing queue":

[12:45:45.227-LocalBuildTask-20] ERROR (Internal): System.Exception: nCrunch.Compiler.NewStaticManipulation.CilTypeHashException: Unable to hash type '***.NotificationsFactoryTest' due to exception: nCrunch.Compiler.NewStaticManipulation.CilHashException: Unable to hash method 'System.Void ***.NotificationsFactoryTest::NotificationsFrom***(System.UInt32, System.UInt32, System.Byte, ***.Notifications.SeverityLevel)' due to exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at nCrunch.Compiler.Cil.AssemblyIdentity.CilAssemblyRefTable.ResolveAssemblyModuleUsingAssemblyId(UInt64 assemblyId)
at nCrunch.Compiler.Cil.CilModule.ResolveTypeByAssemblyQualifiedName(CilQualifiedTypeName qualifiedTypeName)
at nCrunch.Compiler.Cil.Types.CilTypeSignature.GetUnderlyingTypeForEnum()
at nCrunch.Compiler.Cil.CustomAttributes.CilAttributeArgument.get_SizeInBytes()
at nCrunch.Compiler.Cil.CustomAttributes.CilAttributeArgument.get_SizeInBytes()
at nCrunch.Compiler.Cil.CustomAttributes.CilAttributeArgument.get_SizeInBytes()
at nCrunch.Compiler.Cil.CustomAttributes.CilCustomAttributeValue.get_NamedArguments()
at nCrunch.Compiler.NewStaticManipulation.CilMethodHashGenerator.HashCustomAttribute(FNV64& hash, CilCustomAttribute customAttribute)
at nCrunch.Compiler.NewStaticManipulation.CilMethodHashGenerator.(FNV64& , CilMethodDefinition )
at nCrunch.Compiler.NewStaticManipulation.CilMethodHashGenerator.HashMethod(CilMethodDefinition method, Int32 stackSize)
at nCrunch.Compiler.NewStaticManipulation.CilMethodHashGenerator.HashMethod(CilMethodDefinition method, Int32 stackSize)
at nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.(Boolean , ClassMethodData , Dictionary`2 , CilTypeDefinition , FNV64& , CilMethodDefinition )
at nCrunch.Compiler.NewStaticManipulation.BuiltCilAssembly.ExtractClassMethodData(TestFrameworkDescription[] applicableTestFrameworks, IDictionary`2 codeFileIDsByForegroundFilePath, Boolean storeImpactHashes)
at nCrunch.Compiler.NewStaticManipulation.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, 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..()
Remco
#19 Posted : Tuesday, April 7, 2020 12:23:09 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks for sharing this. Can you confirm whether you experience this with the latest version of NCrunch? We've been rolling out CIL-related fixes with great frequency in the newer builds.
mkoertgen
#20 Posted : Tuesday, April 7, 2020 6:39:45 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 7/16/2016(UTC)
Posts: 5
Location: Germany

Thanks: 1 times
Sorry for the typo, my bad. It's definitive the latest NCrunch 4.3.0.13
Users browsing this topic
Guest
2 Pages12>
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.246 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download