Build/Test Issues

Can no longer build projects that use the Polly package

Started by arkiaconsulting on 1,274 views


!!!! EDIT !!!!
It appears that the following has actually nothing related to the 'SupportedOSPlatform' attribute, but to the usage of the 'Polly' package...


After having migrated to VS 2022 17.14.0 Preview 3.0, one of my solution project that targets windows OS (using the `SupportedOSPlatform` attribute no longer builds in Ncrunch. It builds correctly by using Ctrl-Shift-B.

NCrunch 5.14.0.3

Error:


NCrunch has encountered an internal error: System.Exception: System.Exception: Unable to instrument type MyProject.Machine.AimdsClient due to exception: System.Exception: Unable to instrument method System.Void MyProject.Machine.AimdsClient::.cctor() due to exception: System.NotSupportedException: TypeSpec
at nCrunch.Compiler.Cil.Methods.CilMemberReference.ResolveDeclaringType()
at nCrunch.Compiler.Cil.Methods.CilMemberReference.ResolveMethodDefinition()
at nCrunch.Compiler.Cil.Methods.CilMethodSpec.ResolveTemplateMethod()
at nCrunch.Compiler.StaticManipulation.InstrumentationConcerns.RdiInstrumentationConcern.(CilInstruction )
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(IReservedCapacity reservedBackgroundCapacity)
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)

Edited

Hi, thanks for sharing this issue.

It looks like they've introduced a new IL signature that NCrunch hasn't seen before. Is there any chance you can share a sample project that can produce this problem?
Thanks for sending through the sample project. Would you be interested in trying the build below to see if this solves the problem for you?

NCrunch_Console_5.14.0.4.msi
NCrunch_Console_5.14.0.4.zip
NCrunch_GridNodeServer_5.14.0.4.msi
NCrunch_GridNodeServer_5.14.0.4.zip
NCrunch_LicenseServer_5.14.0.4.zip
NCrunch_Rider_5.14.0.4.7z
NCrunch_Rider_5.14.0.4.zip
NCrunch_VS2010_5.14.0.4.msi
NCrunch_VS2010_5.14.0.4.zip
NCrunch_VS2012_5.14.0.4.msi
NCrunch_VS2012_5.14.0.4.zip
NCrunch_VS2013_5.14.0.4.msi
NCrunch_VS2013_5.14.0.4.zip
NCrunch_VS2015_5.14.0.4.msi
NCrunch_VS2015_5.14.0.4.msi.7z
NCrunch_VS2015_5.14.0.4.zip
NCrunch_VS2017_5.14.0.4.msi
NCrunch_VS2017_5.14.0.4.msi.7z
NCrunch_VS2017_5.14.0.4.zip
NCrunch_VS2019_5.14.0.4.msi
NCrunch_VS2019_5.14.0.4.msi.7z
NCrunch_VS2019_5.14.0.4.zip
NCrunch_VS2022_5.14.0.4.msi
NCrunch_VS2022_5.14.0.4.msi.7z
NCrunch_VS2022_5.14.0.4.zip
Hi Remco,

Thanks, I confirm that the project now builds correctly with 5.14.0.4.

Post a reply

Log in to reply.