Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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:

enter image description here

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

like image 901
glosrob Avatar asked Jul 10 '12 03:07

glosrob


2 Answers

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.

like image 62
scott pelger Avatar answered Sep 19 '22 18:09

scott pelger


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!

like image 27
glosrob Avatar answered Sep 21 '22 18:09

glosrob