3
votes

A little bit of background: I recently recompiled the ServiceStack library from its source code (https://github.com/ServiceStack/ServiceStack). I also recompiled the ServiceStack.Text project, after completing some bug fixes. I copied the ServiceStack.Text dll file into the "lib" folder of the ServiceStack project (it is there because the ServiceStack solution does not include the serializers in Text).

Now I am getting TypeLoadExceptions, as follows:

System.TypeLoadException: Method 'get_StatusCode' in type 'ServiceStack.ServiceInterface.Testing.MockHttpResponse' from assembly 'ServiceStack.ServiceInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation. at System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes) at System.Reflection.RuntimeAssembly.GetExportedTypes() at ----my code from here...----

I'm not sure what the issue could be. I suspected it could be a circular DLL reference issue (DLL Hell) because ServiceStack.OrmLite is referenced (which also references back to other solutions in this project); however, after removing all references to ServiceStack projects, I still have not solved the problem.

This post seems to have some ideas, but I have not had any luck following through with those: TypeLoadException says 'no implementation', but it is implemented

1

1 Answers

3
votes

You're using dirty dlls for the different versions of ServiceStack's components which should all be kept in sync.

In the assembly of each major ServiceStack component dll is marked the version number, this matches up with the version that's deployed on NuGet, e.g. the latest version of ServiceStack is v3.9.38, you would want to ensure that you're using at least v3.9.38 of all the other libraries.

The core ServiceStack dependency matrix looks like:

ServiceStack.Text
  +
  > ServiceStack.Interfaces
  > ServiceStack.Common
      + 
      > ServiceStack.Redis
      > ServiceStack.OrmLite
          +
          > ServiceStack
              +
              > ServiceStack.ServiceInterface

If you're using v3.9.38 of ServiceStack.dll, you want to make sure that all sub components above ServiceStack is at least at v3.9.38.