Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AltCover.Prepare msbuild task throws System.InvalidOperationException when instrumenting some assemblies #18

Closed
samarunraj opened this issue May 10, 2018 · 5 comments
Labels

Comments

@samarunraj
Copy link

Version: altcover.3.0.466.nupkg

: error MSB4018: The "AltCover.Prepare" task failed unexpectedly. []
: error MSB4018: System.InvalidOperationException: tried to skip The input sequence has an insufficient number of elements. 1 past the end of the seq []
: error MSB4018:    at [email protected](IEnumerable`1& next) []
: error MSB4018:    at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl() []
: error MSB4018:    at Microsoft.FSharp.Collections.Internal.IEnumerator.map@74.DoMoveNext(b& curr) []
: error MSB4018:    at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext() []
: error MSB4018:    at Microsoft.FSharp.Collections.Internal.IEnumerator.next@187[T](FSharpFunc`2 f, IEnumerator`1 e, FSharpRef`1 started, Unit unitVar0) []
: error MSB4018:    at Microsoft.FSharp.Collections.Internal.IEnumerator.filter@182.System-Collections-IEnumerator-MoveNext() []
: error MSB4018:    at Microsoft.FSharp.Collections.Internal.IEnumerator.map@74.DoMoveNext(b& curr) []
: error MSB4018:    at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext() []
: error MSB4018:    at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeOuter@274[T,TResult](ConcatEnumerator`2 x, Unit unitVar0) []
: error MSB4018:    at Microsoft.FSharp.Collections.Internal.IEnumerator.mapi@88.DoMoveNext(b& curr) []
: error MSB4018:    at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext() []
: error MSB4018:    at Microsoft.FSharp.Collections.Internal.IEnumerator.choose@165.System-Collections-IEnumerator-MoveNext() []
: error MSB4018:    at Microsoft.FSharp.Collections.SeqModule.ToList[T](IEnumerable`1 source) []
: error MSB4018:    at AltCover.Visitor.VisitMethod(MethodDefinition m, Inspect included) in C:\projects\altcover\AltCover\Visitor.fs:line 451 []
: error MSB4018:    at AltCover.Visitor.BuildSequence(Node node) in C:\projects\altcover\AltCover\Visitor.fs:line 497 []
: error MSB4018:    at Microsoft.FSharp.Collections.Internal.IEnumerator.map@74.DoMoveNext(b& curr) []
: error MSB4018:    at Microsoft.FSharp.Collections.Internal.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext() []
: error MSB4018:    at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeOuter@274[T,TResult](ConcatEnumerator`2 x, Unit unitVar0) []
: error MSB4018:    at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@267[T,TResult](ConcatEnumerator`2 x, Unit unitVar0) []
: error MSB4018:    at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@267[T,TResult](ConcatEnumerator`2 x, Unit unitVar0) []
: error MSB4018:    at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@267[T,TResult](ConcatEnumerator`2 x, Unit unitVar0) []
: error MSB4018:    at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@267[T,TResult](ConcatEnumerator`2 x, Unit unitVar0) []
: error MSB4018:    at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@267[T,TResult](ConcatEnumerator`2 x, Unit unitVar0) []
: error MSB4018:    at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@267[T,TResult](ConcatEnumerator`2 x, Unit unitVar0) []
: error MSB4018:    at Microsoft.FSharp.Core.CompilerServices.RuntimeHelpers.takeInner@267[T,TResult](ConcatEnumerator`2 x, Unit unitVar0) []
: error MSB4018:    at Microsoft.FSharp.Collections.SeqModule.Fold[T,TState](FSharpFunc`2 folder, TState state, IEnumerable`1 source) []
: error MSB4018:    at AltCover.Visitor.Visit(FSharpList`1 visitors, IEnumerable`1 assemblies) in C:\projects\altcover\AltCover\Visitor.fs:line 510 []
: error MSB4018:    at [email protected](Unit unitVar0) in C:\projects\altcover\AltCover\AltCover.fs:line 344 []
: error MSB4018:    at AltCover.CommandLine.doPathOperation[a](FSharpFunc`2 f, a defaultValue, Boolean store) in C:\projects\altcover\AltCover\CommandLine.fs:line 131 []
: error MSB4018:    at AltCover.Main.DoInstrumentation(String[] arguments) in C:\projects\altcover\AltCover\AltCover.fs:line 330 []
: error MSB4018:    at AltCover.Prepare.Execute() in C:\projects\altcover\AltCover\Tasks.fs:line 50 []
: error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() []
: error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__25.MoveNext() []```
@SteveGilham
Copy link
Owner

Only one place that can be. Fix applied, will be in next release.

@SteveGilham SteveGilham added bug ready to close Believed addressed, waiting to hear to the contrary labels May 10, 2018
@SteveGilham
Copy link
Owner

Addressed in release 3.0.475

@SteveGilham SteveGilham removed the ready to close Believed addressed, waiting to hear to the contrary label Jul 22, 2018
@zarzyckipawel
Copy link

zarzyckipawel commented Jun 14, 2022

I just noticed that I have a similar error on 15 out of 132 test projects. I am using altcover 8.2.837. Any chance you can help me with that?
The "AltCover.Prepare" task failed unexpectedly.
Mono.Cecil.ResolutionException: Failed to resolve System.Windows.Threading.DispatcherPriority
at Mono.Cecil.Mixin.CheckedResolve(TypeReference self)
at Mono.Cecil.MetadataBuilder.GetConstantType(TypeReference constant_type, Object constant)
at Mono.Cecil.MetadataBuilder.AddConstant(IConstantProvider owner, TypeReference type)
at Mono.Cecil.MetadataBuilder.AddParameter(UInt16 sequence, ParameterDefinition parameter, ParamTable table)
at Mono.Cecil.MetadataBuilder.AddParameters(MethodDefinition method)
at Mono.Cecil.MetadataBuilder.AddMethod(MethodDefinition method)
at Mono.Cecil.MetadataBuilder.AddMethods(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddTypes()
at Mono.Cecil.MetadataBuilder.BuildTypes()
at Mono.Cecil.MetadataBuilder.BuildModule()
at Mono.Cecil.MetadataBuilder.BuildMetadata()
at Mono.Cecil.ModuleWriter.<>c.b__2_0(MetadataBuilder builder, MetadataReader )
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func'3 read)
at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata)
at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable'1 stream, WriterParameters parameters)
at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable'1 stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(Stream stream, WriterParameters parameters)
at Mono.Cecil.AssemblyDefinition.Write(Stream stream, WriterParameters parameters)
at AltCover.Instrument.I.write@542-1(AssemblyDefinition a, String p, WriterParameters pk) in /
//AltCover.Engine/Instrument.fs:line 546
at AltCover.Instrument.I.writeAssembly(AssemblyDefinition assembly, String path) in ///AltCover.Engine/Instrument.fs:line 553
at AltCover.Instrument.I.writeAssemblies(AssemblyDefinition definition, String file, IEnumerable'1 targets, FSharpFunc'2 sink) in /
//AltCover.Engine/Instrument.fs:line 910
at AltCover.Instrument.I.visitAfterAssembly(InstrumentContext state, AssemblyEntry assembly) in ///AltCover.Engine/Instrument.fs:line 1172
at AltCover.Instrument.I.instrumentationVisitorWrapper(FSharpFunc'2 core, InstrumentContext state, Node node) in /
//AltCover.Engine/Instrument.fs:line 1514
at [email protected](T node) in ///AltCover.Engine/Visitor.fs:line 1520
at Microsoft.FSharp.Primitives.Basics.List.mapToFreshConsTail[a,b](FSharpList'1 cons, FSharpFunc'2 f, FSharpList'1 x) in D:\a_work\1\s\src\fsharp\FSharp.Core\local.fs:line 237
at Microsoft.FSharp.Primitives.Basics.List.map[T,TResult](FSharpFunc'2 mapping, FSharpList'1 x) in D:\a_work\1\s\src\fsharp\FSharp.Core\local.fs:line 248
at Microsoft.FSharp.Collections.SeqModule.Fold[T,TState](FSharpFunc'2 folder, TState state, IEnumerable'1 source) in D:\a_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 731
at AltCover.Visitor.visit(IEnumerable'1 visitors, IEnumerable'1 assemblies) in /
//AltCover.Engine/Visitor.fs:line 1506
at [email protected](Unit unitVar0) in ///AltCover.Engine/Main.fs:line 705
at AltCover.CommandLine.I.doPathOperation[a](FSharpFunc'2 f, a defaultValue, Boolean store) in /
//AltCover.Engine/CommandLine.fs:line 248
at [email protected](FSharpFunc'2 f, a defaultValue, Boolean store) in ///AltCover.Engine/CommandLine.fs:line 490
at AltCover.Main.I.doInstrumentation(String[] arguments) in /
//AltCover.Engine/Main.fs:line 681
at AltCover.Main.I.main(String[] arguments) in ///AltCover.Engine/Main.fs:line 756
at [email protected](String[] arguments) in /
//AltCover.Engine/Main.fs:line 762
at AltCover.Prepare.Execute() in /_//AltCover.Engine/Tasks.fs:line 191
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)

@SteveGilham
Copy link
Owner

This looks more like a variation on issue #20 than anything else -- only this time it's a type resolution rather than an assembly resolution that is failing. It would be best treated by opening a new issue while I try to reverse engineer the cause.

@zarzyckipawel
Copy link

Thank you for a quick feedback. I created a new issue 156. While I am still trying to figure out what circumstances are causing this problem to occur.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants