【问题标题】:ServiceStack: Upgrade to 5.4.1 gives me ReflectionTypeLoadException on ServiceStack.CommonServiceStack:升级到 5.4.1 在 ServiceStack.Common 上给了我 ReflectionTypeLoadException
【发布时间】:2019-07-17 22:44:53
【问题描述】:

我运行的是 ServiceStack 5.2.0,直到我升级到 to this answer

完成此操作并再次运行应用程序后,我现在在处理程序集时得到ReflectionTypeLoadException ServiceStack.Common, Version=5.0.0.0, Culture=neutral, PublicKeyToken=02c12cbda47e6587

在我的代码中,出于某种与此问题无关的原因,我执行以下操作:

Type[] typeArray = assembly.GetTypes();

当我这样做时,我得到了这个错误:

{“方法 'GetKeyValuePairs' 在程序集 'ServiceStack.Common, Version=5.0.0.0, Culture=neutral, PublicKeyToken=02c12cbda47e6587' 的类型 'ServiceStack.SimpleAppSettings' 中没有实现。”:“ServiceStack.SimpleAppSettings” }

我想“让我们避免处理 Servicestack,因为这不是我真正想要的”,所以我将其更改为:

if (!assembly.DefinedTypes.Any(x => x.FullName.StartsWith("SomeThing")))

但是当执行到这一行时我仍然得到同样的错误。

更新

升级后,我居然在别处也看到了 LoaderExceptions:

System.Reflection.ReflectionTypeLoadException:无法加载一个或 更多请求的类型。检索 LoaderExceptions 属性 了解更多信息。在 System.Reflection.RuntimeModule.GetTypes(RuntimeModule 模块)在 System.Reflection.RuntimeModule.GetTypes() 在 System.Reflection.Assembly.GetTypes() 在 tWorks.Core.CoreServerCommons.RequestProcessing.RequestProcessorFactory`2.c.b__8_0(组装 组装)在 ....RequestProcessorFactory.cs:行 105

一些底层库出了什么问题?

【问题讨论】:

    标签: servicestack


    【解决方案1】:

    正如 Mythz 在 cmets here 中所说,所需要做的就是清除 NuGet 缓存:

    VS --> Tools --> NuGet Packet Manager --> Packet Manager Settings --> Clear All NuGet Caches(s)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-12-21
      • 1970-01-01
      • 2019-07-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多