Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

servicestack

I encountered the following error after upgrading to ServiceStack 5.0.2

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" />

Here are the reference seen from VS.

enter image description here

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

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

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

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.

enter image description here

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

Why it is trying to load an older version?

like image 297
Mr.Wang from Next Door Avatar asked Nov 24 '25 06:11

Mr.Wang from Next Door


1 Answers

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.

like image 191
mythz Avatar answered Nov 28 '25 18:11

mythz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!