Method X from Type Y in Assembly Z does not have an Implementation

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-31 01:45:08

问题


I am very confused!

I have a solution that, when published and deployed gives the me the following error:

Exception information: 
Exception type: HttpException 
Exception message: Method 'GetDemosSubsidiaryById' in type 'DG.Crm.DataAccess.Crm2011WS.Repositories.ReferenceEntitiesRepository' from assembly 'DG.Crm.DataAccess.Crm2011WS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
<stack trace>

Obviously it builds fine and the method is implemented and definitely exists in the library. I have used reflector to check the deployed DLLs and I can't see anything out of the ordinary there either - classes exist, types are there, method is implemented. The particular method it is complaining about isn't even called, either.

I have removed all references and readded them in the solution.

I have recreated DG.Crm.DataAccess.Crm2011WS.Repositories.ReferenceEntitiesRepository by using the the 'Implement Interface' shortcut in Visual Studio.

The solution loads and works fine from within Visual Studio.

What am I missing here or where else can I look for more information?

edit to add on solution structure:

The 2011WS library implements interfaces that live in the Common library. Both are then referenced by the WebApps MVC web application.


回答1:


Just an FYI...i had this same exact error. in my case it turned out to be assembly B being referenced by assembly A that was not in the GAC. the error indicated a problem with assembly A so was a bit misleading.




回答2:


Turns out there was an older version of one of the libraries in the GAC. The issue I had was the library in conflicting was the DTO one, and not those referenced in the error.

So in my instance, be more careful about what lives in the GAC!



来源:https://stackoverflow.com/questions/11406298/method-x-from-type-y-in-assembly-z-does-not-have-an-implementation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!