question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Unhandled Exception: Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly" for referenced package assembly.

See original GitHub issue

I was attempting to instrument code coverage for my persistence tests using: dotnet minicover instrument --assemblies bin/**/*.dll --sources "../Persistence/**/*.cs"

It resulted in the following output:

Instrumenting assembly "Persistence"
Instrumenting assembly "Persistence"
Instrumenting assembly "Persistence"

Unhandled Exception: Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'Nest, Version=6.0.0.0, Culture=neutral, PublicKeyToken=96c599bbe3e70f5d
'
   at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
   at Mono.Cecil.DefaultAssemblyResolver.Resolve(AssemblyNameReference name)
   at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
   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.AddField(FieldDefinition field)
   at Mono.Cecil.MetadataBuilder.AddFields(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.<BuildMetadata>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(String fileName, WriterParameters parameters)
   at MiniCover.Instrumentation.Instrumenter.InstrumentAssemblyIfNecessary(String assemblyFile)
   at MiniCover.Instrumentation.Instrumenter.VisitAssemblyGroup(IEnumerable`1 assemblyFiles)
   at MiniCover.Instrumentation.Instrumenter.Execute()
   at MiniCover.Program.<>c__DisplayClass0_0.<Main>b__1()
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at MiniCover.Program.Main(String[] args)

I believe it is related to #6, but the assembly it needs is not in my bin directory, it is instead a referenced nuget package.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lucaslorentzcommented, Jun 16, 2018

@laskoviymishka @Arbixal Can you please try the version 2.0.0-ci-20180517205544 without CopyLocalLockFileAssemblies. @baor implemented assembly resolving and I think this issue might be fixed now.

0reactions
lucaslorentzcommented, Jul 5, 2018

Closing as it seems to be fixed. @Arbixal, please re-open if it still fails for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mono Cecil add missing assembly
For some reason when I try to load some assembly and analyze it, I'm getting error Mono.Cecil.AssemblyResolutionException: Failed to resolve ...
Read more >
[5.2.1p3] Mono.Cecil.AssemblyResolutionException ...
Hi, I am getting this error on Unity 5.2.1p3. Basically, Unity is failing to resolve UnityEngine.UI. Any idea what could be causing this?...
Read more >
MTOUCH : error MT2001: Could not link assemblies. Reason
Reason: Error while processing references ofClosed - Not a Bug6 48 ... Cecil.AssemblyResolutionException: Failed to resolve assembly: ...
Read more >
MSB3277: Found conflicts between different versions of ' ...
This error occurs during a build when more than one version of the same dependent assembly is referenced in a build of the...
Read more >
exception ILLink when building Blazor WASM hosted in ...
Mono.Linker.LoadException: Error while processing references of 'Telerik. ... Cecil.AssemblyResolutionException: Failed to resolve assembly: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found