Error loading Octopus.Client.dll on Octopus Cloud Instance

I’m getting the following error when attempting to run a C# script:

20:24:05   Error    |       Unhandled Exception: System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
20:24:05   Error    |       at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
20:24:05   Error    |       at System.Reflection.Assembly.LoadFile(String path)
20:24:05   Error    |       at ScriptCs.Hosting.ModuleLoader.Load(IModuleConfiguration config, String[] modulePackagesPaths, String hostBin, String extension, String[] moduleNames)
20:24:05   Error    |       at ScriptCs.Hosting.ScriptServicesBuilder.LoadModules(String extension, String[] moduleNames)
20:24:05   Error    |       at ScriptCs.Application.Run(Config config, String[] scriptArgs)
20:24:05   Error    |       at ScriptCs.Program.Main(String[] args)

A portion of the C# script (seems to be failing on line 1):

#r "C:\\Program Files\\Octopus Deploy\\Octopus\\Octopus.Client.dll"
using Octopus.Client;
using Octopus.Client.Model;

// edited for brevity...

This script step is running on a worker in the Default Worker Pool on my Octopus Cloud instance. This used to work up until today.

Hi Brian,

Thanks for getting in touch! I just ran a similar script on a cloud instance that is running 2019.1.7 and everything worked fine. I will need a bit more information to get to the bottom of this problem.

#r "C:\\Program Files\\Octopus Deploy\\Octopus\\Octopus.Client.dll"
using Octopus.Client;
using Octopus.Client.Model;

var server = "http://myoctopusserver/";
var apiKey = "API-XXXXXXXX";       
var endpoint = new OctopusServerEndpoint(server, apiKey);
  1. Can you provide me with an export of your deployment process?

image

  1. Would you be ok for me to access your instance directly? If so, can you please create a sample project that reproduces the problem and let me know what its name is?

Regards,

Pawel

Our instance got updated to 2019.1.7 last night. I retried this morning but the error is still occurring.

Yes, you can access our instance. The sample project you can use to recreate this issue on our instance is under Projects > Experiments > Sandbox.

Hi,

We’ve figured out what the problem is and we will fix it during your next maintenance window which starts in 30 minutes.

Regards,

Pawel

1 Like