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.

ImportReference throws NotImplementedException on core

See original GitHub issue

I am using Fody to create a weaver that uses cecil.

When calling ModuleDefinition.ImportReference(MethodBase) on .NET Core passing a method from a generic class it throws a NotImplementedException. I believe I am hitting the exception case here from here.

For reference I have created a sample repository showing the issue here (full disclosure, the referenced dlls are from the distributed Fody NuGet, however the source appears to match for this particular case).

So my question is this, how should I go about getting a MethodReference from a System.Reflection.MethodBase object in .NET Core?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jbevaincommented, Mar 26, 2018

Let’s keep that open. I want to move to the .net standard 2 for the next release.

0reactions
atykhyycommented, Sep 9, 2021

A much more robust approach than I described above is to make the reflection and metadata importers handle facade assemblies. I have put the helper code in atykhyy/cecil-msbuild-helper.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does NotImplementedException exist?
The exception is thrown when an invoked method is not supported. For instance when there is an attempt to read, seek, or write...
Read more >
NotImplementedException Class (System)
The NotImplementedException exception is thrown when a particular method, get accessor, or set accessor is present as a member of a type but...
Read more >
Resolving package references in .NET Core not supported?
NET Core assumes the published case, where all package references are copied ... ImportReference throws NotImplementedException on core #505.
Read more >
Use of NotImplementedException
I am the "hard error" type of guy: I will throw an exception at the slightest hint that something might be wrong; I...
Read more >
C# NotImplementedException
The NotImplementedException indicates in a clear way that the functionality being requested was simply not implemented. Exception. Example. The ...
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