Document that C# script steps require the .NET SDK - #3333
Draft
NickJosevski wants to merge 1 commit into
Draft
Conversation
NickJosevski
marked this pull request as draft
August 11, 2026 02:12
C# scripts (.csx) run through dotnet-script, which always shells out to `dotnet restore` -- even for a script with no NuGet references -- so the machine running the step needs the .NET SDK, not just the runtime. This has been true since the scriptcs to dotnet-script migration, but was only ever stated in a 2021 blog post that is now stale on the version. A runtime-only target fails with "Unable to restore packages from '.../script.csproj' / Make sure that all script files contains valid NuGet references", which points people at their NuGet references rather than the missing SDK. The docs now quote that message so a search for it lands here. - custom-scripts/index.md: new "C# script requirements" section - linux/ssh-requirements.md: its ".NET" section said the opposite, which is true for self-contained Calamari but not for C# scripts - system-variables.md: only one NuGet source can be supplied via Octopus.Action.Script.CSharp.NuGetSource, and it replaces the default No SDK version is named. dotnet-script derives the generated project's target framework from whichever runtime the `dotnet` on the path resolves, so the requirement is relative to that runtime. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
NickJosevski
force-pushed
the
nj/csharp-script-sdk-requirement
branch
from
August 11, 2026 02:14
1455c0b to
90d8995
Compare
|
Pull request environment is available at https://stoctodocspr3333.z22.web.core.windows.net. You can view the ephemeral environment status in Octopus Deploy. This environment will be automatically deprovisioned when the pull request is closed, or after 7 days of inactivity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
C# scripts (
.csx) run through dotnet-script, which always shells out todotnet restore— even for a script with no NuGet references — so the machine running the step needs the .NET SDK, not just the runtime. That machine is a deployment target, a worker, or the Octopus Server.This has been true since the scriptcs → dotnet-script migration, but was only ever stated in a 2021 blog post that is now stale on the version. A runtime-only target fails with:
which points people at their NuGet references rather than the missing SDK. The docs now quote that message so a search for it lands here.
Changes
deployments/custom-scripts/index.md— new "C# script requirements" sectioninfrastructure/deployment-targets/linux/ssh-requirements.md— its.NETsection said the opposite, which is true for self-contained Calamari but not for C# scriptsprojects/variables/system-variables.md— only one NuGet source can be supplied viaOctopus.Action.Script.CSharp.NuGetSource, and it replaces the default rather than adding to itNo SDK version is named. dotnet-script derives the generated project's target framework from whichever runtime the
dotneton the path resolves, so the requirement is relative to that runtime rather than a number that would go stale the way the blog post'snet6.0did.Docs only.
🤖 Generated with Claude Code