背景:我最近从ServiceStack源代码(https://github.com/ServiceStack/ServiceStack)重新编译了它的库。在完成一些bug修复之后,我还重新编译了ServiceStack.Text项目。我将ServiceStack.Text dll文件复制到ServiceStack项目的"lib“文件夹中(因为ServiceStack解决方案不包括文本中的序列化程序)。
现在我得到了TypeLoadExceptions,如下所示:
'ServiceStack.ServiceInterface.Testing.MockHttpResponse‘类型的System.TypeLoadException:来自程序集'ServiceStack.ServiceInterface,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null’的方法'get_StatusCode‘没有实现。在System.Reflection.RuntimeAssembly.GetExportedTypes(RuntimeAssembly大会,ObjectHandleOnStack retTypes)在System.Reflection.RuntimeAssembly.GetExportedTypes() at -我的代码从这里.
我不知道会有什么问题。我怀疑这可能是一个循环DLL引用问题(DLL地狱),因为引用了ServiceStack.OrmLite (也引用了这个项目中的其他解决方案);但是,在删除了对ServiceStack项目的所有引用之后,我仍然没有解决这个问题。
这篇文章似乎有一些想法,但我对以下这些并没有任何运气:TypeLoadException says 'no implementation', but it is implemented。
发布于 2013-03-14 19:50:29
您正在为ServiceStack组件的不同版本使用脏all,这些组件都应该保持同步。
在每个主要ServiceStack组件dll的程序集中,都标记版本号,这与部署在NuGet上的版本相匹配,例如,ServiceStack的最新版本是v3.9.38,您需要确保至少使用所有其他库的v3.9.38。
核心ServiceStack依赖矩阵如下所示:
ServiceStack.Text
+
> ServiceStack.Interfaces
> ServiceStack.Common
+
> ServiceStack.Redis
> ServiceStack.OrmLite
+
> ServiceStack
+
> ServiceStack.ServiceInterface如果使用的是v3.9.38 of ServiceStack.dll,则需要确保ServiceStack上的所有子组件至少位于v3.9.38。
https://stackoverflow.com/questions/15418269
复制相似问题