Using in an Octopus Step

You can use Octopus.Client from inside Octopus (for example in a script step or a package install script) by referencing it as a package. You can configure nuget.org as an External Feed that provides this package. Octopus will automatically extract this package for you, allowing your script to reference the .dll file it contains using a relative path. For example:

PowerShell
Add-Type -Path 'Octopus.Client/lib/netstandard2.0/Octopus.Client.dll'
C#
#r "Octopus.Client/lib/netstandard2.0/Octopus.Client.dll"
using Octopus.Client;
using Octopus.Client.Model;

The credentials would still need to be supplied to establish the connection.

Using Octopus.Client from installation folder

Octopus Server and Tentacle both ship with a version of Octopus.Client.dll in the installation directory. Avoid using this in your scripts as this is considered an implementation detail of those products. As such it is subject to change at any time, and not guaranteed to work with your version of Octopus Server.

Help us continuously improve

Please let us know if you have any feedback about this page.

Send feedback

Page updated on Sunday, January 1, 2023