Issues with Mono 6.x

Hello, we’re running a C# project on a Linux SSH Target. The script goes well until we get these errors:

(482,24): error CS0584: Internal compiler error: The method or operation is not implemented.
January 5th 2023 11:45:58Error
(513,39): error CS0584: Internal compiler error: The method or operation is not implemented.
January 5th 2023 11:45:58Error
(1,2): error CS0103: The name Octopus' does not exist in the current context January 5th 2023 11:45:58Error (1,23): error CS0103: The name Octopus’ does not exist in the current context
January 5th 2023 11:45:58Error
(1,19): error CS0103: The name filteredParams' does not exist in the current context January 5th 2023 11:45:58Error (2,4): error CS0103: The name filteredParams’ does not exist in the current context
January 5th 2023 11:45:58Error
(1,42): error CS0103: The name Octopus' does not exist in the current context January 5th 2023 11:45:58Error (1,28): error CS0103: The name targetPath’ does not exist in the current context
January 5th 2023 11:45:58Error
(3,25): error CS0103: The name `targetPath’ does not exist in the current context
January 5th 2023 11:45:58E

Looks like it can’t access Octopus variables.

This’s the general info:

Linux Distro: Ubuntu Focal
Mono version: 6.12.0.182
Octopus server: 2022.3(Build 10847)

The script goes through if we run it on Mono 5.16.0.187, Ubuntu Bionic. We cannot downgrade it because Mono 5 is not available in Ubuntu Focal.

Hi @itsystemshq

Thanks for reaching out, and sorry to hear you’re having issues with getting your c# scripts to work under mono - it looks like you’re hitting this issue stemming from some changes made in mono in versions > 5.16.

Sadly this is still on the backlog, due to mono’s very low usage rate resulting in a lot of other work being triaged higher. I’ll raise this up with the team though, and see if we can get it looked at.

In the meantime, it is possible to install 5.14/5.16 on Focal/Jammy by using apt snapshots and preferences using the following steps:

  1. Adjust your sources to point to the snapshot of the version you want to run:
$ cat /etc/apt/sources.list
<snip>
# deb-src http://security.ubuntu.com/ubuntu focal-security multiverse
deb https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177 main 
  1. Set you apt preferences to use the mono repo version, even though it is lower than the ubuntu repo:
$ cat /etc/apt/preferences.d/preferences
Package: *
Pin: origin download.mono-project.com 
Pin-Priority: 1001
  1. Install mono-complete as normal:
$ sudo apt-get install mono-complete
<snip>
Get:52 http://us-west-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libgail-common amd64 2.24.32-4ubuntu4 [116 kB]
Get:53 http://us-west-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libgif7 amd64 5.1.9-1 [32.2 kB]
Get:54 http://us-west-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libgdk-pixbuf2.0-bin amd64 2.40.0+dfsg-3ubuntu0.4 [14.1 kB]
Get:55 http://us-west-2.ec2.archive.ubuntu.com/ubuntu focal/universe amd64 libglade2-0 amd64 1:2.6.4-2ubuntu2 [44.3 kB]
Get:56 http://us-west-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libgtk2.0-bin amd64 2.24.32-4ubuntu4 [7728 B]
Get:57 http://us-west-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 pkg-config amd64 0.29.1-0ubuntu4 [45.5 kB]
Get:58 https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177/main amd64 mono-runtime-sgen amd64 5.14.0.177-0xamarin3+ubuntu1804b1 [1562 kB]
Get:59 https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177/main amd64 mono-runtime amd64 5.14.0.177-0xamarin3+ubuntu1804b1 [22.7 kB]
Get:60 https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177/main amd64 libmono-corlib4.5-cil all 5.14.0.177-0xamarin3+ubuntu1804b1 [1111 kB]
Get:61 https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177/main amd64 libmono-posix4.0-cil all 5.14.0.177-0xamarin3+ubuntu1804b1 [89.6 kB]
Get:62 https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177/main amd64 libmono-system-core4.0-cil all 5.14.0.177-0xamarin3+ubuntu1804b1 [281 kB]
Get:63 https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177/main amd64 libmono-system-numerics4.0-cil all 5.14.0.177-0xamarin3+ubuntu1804b1 [57.6 kB]
Get:64 https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177/main amd64 libmono-system-xml4.0-cil all 5.14.0.177-0xamarin3+ubuntu1804b1 [812 kB]
Get:65 https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177/main amd64 libmono-system-security4.0-cil all 5.14.0.177-0xamarin3+ubuntu1804b1 [77.2 kB]
Get:66 https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177/main amd64 libmono-system-configuration4.0-cil all 5.14.0.177-0xamarin3+ubuntu1804b1 [62.2 kB]
Get:67 https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177/main amd64 libmono-system4.0-cil all 5.14.0.177-0xamarin3+ubuntu1804b1 [840 kB]
Get:68 https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177/main amd64 libmono-security4.0-cil all 5.14.0.177-0xamarin3+ubuntu1804b1 [124 kB]
Get:69 https://download.mono-project.com/repo/ubuntu bionic/snapshots/5.14.0.177/main amd64 mono-4.0-gac all 5.14.0.177-0xamarin3+ubuntu1804b1 [163 kB]
<snip>

We do realise that this isn’t the ideal solution, but if this is a hard blocker for you, that can’t be worked around otherwise, it may provide a way forward.

I hope this helps, and please don’t hesitate to let us know if you have any further questions.

Hi Justin,

Thank you for your fast reply. Please keep me posted about the update. You know this is not a secured solution and the initial report was a couple years ago, so please try to help us, even if this is something not to many people use, you need to be responsible with it.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.