Improve C# scripting

The C# scripting needs to be improved for a better developer experience and functionality.

  1. Please support modern C# language versions (8, 9, or 10 would be great)
  2. Able to run scripts on a new CLR (.NET 5 or .NET 6, or .NET Core 3.1)
  3. Improve experience on how to use third party libraries via NuGet.
    At the moment you need to add NuGet.org as external feed, Add a package reference to your script (without a version) and add something like this to your script
#r "./System.Text.Json/lib/net461/System.Text.Json"

It would be awesome when you can write (similar to Cakebuild.net)

#r "nuget:?package=System.Text.Json&version=6.0.1"

Good morning @toni.wenzel2,

Thank you for getting in touch and for the suggestions and explanation behind the limitations you’re experiencing.

I’ll pass on your observations to our developers and get back to you with any updates or queries.

Anything you need in the meantime please don’t hesitate to reach out!

Kind Regards,

Clare Martin

Good afternoon @toni.wenzel2,

Just following up on your post before the Octopus Deploy team are down to a skeleton crew for the Christmas and New Year break.

Our team are currently discussing your recommendations and ways to improve our services in this area. I will keep you updated on this as the discussions progress and it will be triaged accordingly.

I do have one recommendation from one of our engineers in that you could have a wrapper script in Bash or PowerShell that can call into your C# script (which could be either inlined or referenced in a package). That way you can have full control over the execution environment for your script and not be limited to what Octopus supports.

I hope this helps in the short term but I just wanted to keep you updated and let you know your recommendations are being discussed but they are likely to be implemented over a longer period of time as we look into improving our services and support for scripting languages etc.

Please let me know if there is anything else you need in the meantime and I will try and keep you updated on the discussions going forward.

I hope you have a good Christmas and New Year,

Kind Regards,

Clare Martin

Hey Toni,

Hope you had a great holiday period!

I’m in the engineering team responsible for this area of Octopus. Thankyou for your suggestions :slight_smile:

I’ve created a GitHub issue to cover this one. You can follow along there for updates/progress. It’s intentionally been left light-on in the detail for now - it will get fleshed out further when it gets picked up by our team.

Cheers,
Matt

1 Like