System.TypeLoadException: Method 'get_xxx' does not have an implementation

前端 未结 7 1963
无人及你
无人及你 2021-01-12 00:16

There are a lot of questions floating around with this problem and i\'ve worked through them ll with no joy.

I am receiving this error:

Method

相关标签:
7条回答
  • 2021-01-12 00:57

    OK, so bizarrely adding a reference to App.Web in Api.Web and removing it again has solved the issue.

    I have no idea why, but it did.

    I changed the version of App.Web to 1.0.0.1 and the error was still showing 1.0.0.0, which is what prompted me to do it.

    I wish there was a more reasonable explanation but there isn't. Such an infuriating issue i'm just glad to be done with it.

    Best of luck to anyone else who experiences this, my thought's are with you

    0 讨论(0)
  • 2021-01-12 01:03

    try this

    public interface IResourceCompiler
    {
        string UserImageCDNUrl {get;}
    }
    
    public abstract class WebConfigBase : IResourceCompiler
    {
        public abstract string UserImageCDNUrl {get;}
    }
    
    public class WebConfig : WebConfigBase 
    {
        public override string  UserImageCDNUrl { return "whatever you want";}
    }
    

    or that way too:

    public interface IResourceCompiler
    {
        string UserImageCDNUrl {get;}
    }
    
    public abstract class WebConfigBase : IResourceCompiler
    {
        public virtual string UserImageCDNUrl {get { return string.empty;}}
    }
    
    public class WebConfig : WebConfigBase 
    {
        public override string  UserImageCDNUrl { return "whatever you want";} // or return base.UserImageCDNUrl ;
    }
    
    0 讨论(0)
  • 2021-01-12 01:06

    I just remove the reference of current project (which is showing error) , and add again to other project in which project this was referenced build and it start working fine.

    hope this help someone.

    0 讨论(0)
  • 2021-01-12 01:12

    In many cases I become this error. It seems like Cached assembly and I found them in UserProfile.

    My solution is:

    1. Save solution and close Visual Studio
    2. Delete entire folder "c:\Users(user)\AppData\Local\Microsoft\VisualStudio\14.0\ProjectAssemblies\"
    3. Start Visual Studio
    4. Work...

    Hope it helps.

    0 讨论(0)
  • 2021-01-12 01:16

    For the records, in my case this was caused by two projects referencing different versions of the same package. At least fixing this solved the issue.

    0 讨论(0)
  • 2021-01-12 01:16

    I was seeing this problem in Visual Studio 2017.

    Upgrading to visual studio 2019 solved the problem for me.

    0 讨论(0)
提交回复
热议问题