4

the error message is: Could not load file or assembly 'Microsoft.OData.Client, Version=7.5.2.21120, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

enter image description here

only this publish failed. others success. My understanding is this dll should be loaded in runtime. what is the location of it?

1 Answer 1

5

This is because most probably you reference Microsoft.OData.Client library in some event system, but you have not merged it with current DLL. Exception is self-explanatory. Some piece of your code cannot reference Microsoft.OData.Client library. By MSDN, it's not part of .NET framework, so you need to deploy it reference it additionally (either by merging it with your Event System into a single DLL using ILMerge or similar tool), or by (which is a worse-case scenario) adding it into a GAC.

3
  • I added this dll with the version to GAC. but the error is still there. I also added Microsoft.OData.Core and Microsoft.OData.Edm with the same version
    – Ivy Chen
    Dec 4, 2019 at 10:10
  • have you added the correct version, with right name in GAC, or any other version. I ask because GAC is version specific.
    – Marko Milic
    Dec 4, 2019 at 10:11
  • Yes, I can confirm it's correct version
    – Ivy Chen
    Dec 4, 2019 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.