无法加载文件或程序集 ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43 [英] Could not load file or assembly ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43

查看:48
本文介绍了无法加载文件或程序集 ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在升级到 ServiceStack 5.0.2 后遇到以下错误

I encountered the following error after upgrading to ServiceStack 5.0.2

无法加载文件或程序集 ServiceStack.Interfaces,版本=4.0.0.0,文化=中性,PublicKeyToken=e06fbc6124f57c43

Could not load file or assembly ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43

这是我的项目文件中的引用

Here are the references in my project file

<PackageReference Include="ServiceStack" Version="5.0.2" />
<PackageReference Include="ServiceStack.Api.Swagger" Version="5.0.2" />
<PackageReference Include="ServiceStack.Text" Version="5.0.2" />

这里是从VS看到的参考.

Here are the reference seen from VS.

我在项目文件中没有ServiceStack.Interfaces"参考.所以它以某种方式被间接引用.

I dont have 'ServiceStack.Interfaces' reference in project file. So it is referenced indirectly somehow.

我不知道为什么在引用 ServiceStack 5.0.2 时它会尝试加载旧版本 4.0.0.0.

I dont know why it is trying to load an older version 4.0.0.0 when ServiceStack 5.0.2 is referenced.

所以我打算在 app.config 中添加绑定副本,但后来我发现这是不可能的.

So I intended to add bind rediction in app.config but then I found that is impossible.

在二进制文件夹中,我确实在那里看到了 ServiceStack.Interfaces.dll.它的版本是 5.0.0.0 但它的 PublicKeyToken 为空.它不允许重定向绑定.

In the binary folder, I do see ServiceStack.Interfaces.dll there. Its version is 5.0.0.0 but its PublicKeyToken is null. It does not allow redirecting the binding.

我尝试在下面添加直接引用,但这并不能解决我的问题.

I tried to add a direct reference below but that does not solve my issue.

为什么要尝试加载旧版本?

推荐答案

删除您的 NuGet /packages 文件夹并再次从 NuGet 恢复.你应该只有 ServiceStack v5.0.2 依赖项,如果你有任何其他版本,你仍然有旧的包引用,仍然需要升级到 v5.0.2.

Delete your NuGet /packages folder and restore from NuGet again. You should only have ServiceStack v5.0.2 dependencies, if you have any other version you still have old package references that still need upgrading to v5.0.2.

这篇关于无法加载文件或程序集 ServiceStack.Interfaces, Version=4.0.0.0, Culture=neutral, PublicKeyToken=e06fbc6124f57c43的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆