Status
This is a confirmed defect in Octopus Deploy, fixed in 2026.4.12920 and later. There is no workaround, so upgrading is the only way to resolve it.
Affected versions
The defect is confirmed in 2026.4.9190 and affects 2026.4 releases earlier than 2026.4.12920. Releases from 2026.4.12920 onward include the fix.
Symptom
A C# script that uses native packages (such as NuGet packages that ship native libraries) fails when the Octopus.Action.Script.CSharp.BypassIsolation variable is set to true. The script fails with an error like this:
System.DllNotFoundException: Unable to load DLL 'Microsoft.Data.SqlClient.SNI.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)
at Microsoft.Data.SqlClient.SNINativeMethodWrapper.UnmanagedIsTokenRestricted(...)
...
at Dotnet.Script.Core.ScriptRunner.Execute[TReturn](String dllPath, IEnumerable`1 commandLineArgs)
Why it happens
This is a defect in Octopus Deploy, not a configuration mistake. When Octopus.Action.Script.CSharp.BypassIsolation is set to true, C# scripts that rely on native libraries from packages can't load them, and the script fails.
Fix
Upgrade to Octopus Deploy 2026.4.12920 or later. After upgrading, C# scripts that use native packages run successfully when Octopus.Action.Script.CSharp.BypassIsolation is set to true.
Tracking
C# scripts using native packages fail when BypassIsolation is true (GitHub issue #10405)