Could not load file or assembly System.Runtime.CompilerServices.Unsafe, The located assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Cenk 1,021 Reputation points
2021-08-29T08:45:34.943+00:00

Hello guys,

I have a web API that was working without a problem. But today I am getting this error on the production server:

Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)

There is no such problem with the local machine. I tried to update this System.Runtime.CompilerServices.Unsafe but still having the same problem. Any ideas on how to fix it?

Best Regards.

.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,163 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.