Could not load file or assembly 'System.ValueTuple'

Hi Octopus Team,

Just recently, when I try to do deployments to some of the servers, and got following errors:

System.IO.FileLoadException: Could not load file or assembly 'System.ValueTuple, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
13:21:11   Error    |       File name: 'System.ValueTuple, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' ---> System.IO.FileLoadException: Could not load file or assembly 'System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
13:21:11   Error    |       File name: 'System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

Server:
Windows server 2012 R2
.Net Framework 4.5.2
image

I have read 2 other similar issues logged in this forum, but still no luck in resolving mine. Please help. Thanks.

Jian

Hi @jianhuang,

Thanks for getting in touch! We have had a couple of customer report for what looks like to be the same exception here, this may be the issue you are referring to. We still haven’t managed to get to the bottom of it, however something that has help on certain environments is to upgrade the version of .Net to 4.7

If that fails to work, you could also try adding the following to Calamari.exe.config on the failing server:

<assemblybinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentassembly>
    <assemblyidentity name="System.ValueTuple" publickeytoken="cc7b13ffcd2ddd51" culture="neutral"></assemblyidentity>
    <bindingredirect oldversion="0.0.0.0-4.0.2.0" newversion="4.0.2.0"></bindingredirect>
  </dependentassembly>
</assemblybinding>

Would you be able to give this a go and let me know if it helps resolve this issue?

Looking forward to hearing from you.

Best regards,
Daniel

Hi Daniel,

The above workaround is not working for me, however, I found a workaround which worked for me, maybe this could give you some insight to the root cause of this error.

workaround:
I found out that under the GAC location, there is an empty folder
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.ValueTuple\v4.0_4.0.0.0__cc7b13ffcd2ddd51
After I copy one System.ValueTuple.dll into this folder, the Octopus deployment works fine. I guess for some reason it is actually looking for the DLL file under GAC.

Thanks,

Jian

Any update on this issue?

Jian

Hi @jianhuang,

Thanks for getting back here. This issue seems to be related to something Microsoft has done and not something Octopus is able to resolve. I believe this was a problem with some versions of .NET framework. I found a StackOverflow conversation regarding this issue which has some more details.

As I mentioned, Octopus is not able to do much to help here. The fix seems to be to upgrade your .NET version, or the workaround which you performed here.

If you have any further questions here, please don’t hesitate to let me know.

Best regards,
Daniel

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.