Hi,
Thanks for getting in touch.
You’d need to create a package with all of your script’s dependent assemblies. Octopus uses ScriptCS to execute C# scripts, so your C# script(s) would need have a .csx extension. You may also need to reference your assemblies, which you can do as follows:
Eg. Where the DLLs sit in the same folder as the script in your package:
#r "Microsoft.Web.Administration.dll";
using (var serverManager = new Microsoft.Web.Administration.ServerManager())
{
Console.WriteLine("hey this works");
}
If for some reason you are unable to use packages for your C# scripts, you’d need to make your assemblies available for the tentacle when it is executing the scripts inline.
When inline script work is assigned for an Octopus tentacle to execute, the scripts are streamed to a temporary folder (typically located at C:\Octopus[your tentacle folder]\Work). This temporary work folder will be named with a datestamp, the script will be executed, and the temporary folder will then be removed.
So if you needed inline scripts to reference assemblies, you could copy your assemblies into the tentacle’s \Work folder, then use a relative path to reference the assembly, like so:
Eg. For inline scripts, where the assemblies are located in the tentacle’s Work folder, one up from where the temporary folder is created to execute the script:
#r "../Microsoft.Web.Administration.dll";
using (var serverManager = new Microsoft.Web.Administration.ServerManager())
{
Console.WriteLine("hey this works too");
}
You can find more information in the Referencing assemblies section of ScriptCS here.
Hope that helps
Cheers
Mark