Unity + C# Interactive

Answered

I'm interested in using the C# Interactive window mentioned in https://blog.jetbrains.com/dotnet/2017/12/01/c-interactive-rider/ .

I'm using Unity on a Mac. I set the tool path to `/Applications/Unity/Hub/Editor/2019.1.13f1/Unity.app/Contents/Mono/bin/csharp`, and when I try to start a new C# Interactive Session I get this error:

 

/Applications/Unity/Hub/Editor/2019.1.13f1/Unity.app/Contents/Mono/bin/csharp --
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the `/Users/builduser/buildslave/mono/build/tmp/monoprefix/lib/mono/2.0/mscorlib.dll' directory.

 

How do I set this up properly when mono is installed under Unity's path?

Who is build user? Why does he have a slave? Why is it so weird to edit text in this forum?

2 comments
Comment actions Permalink

Hello Rob,

Could you please clarify if C# interactive works when using Mono executable path that is detected automatically in Rider(File | Settings | Build, Execution, Deployment | Toolset and Build)? Could you please also clarify if you can Run/Debug Unity project at all with your settings? Could you please also collect the log bundle using the following instruction and attach them here or create an issue on our bug tracker for further investigation? Thank you in advance!

0
Comment actions Permalink

Hello Olga,

Thanks for your reply!

Short answer: I tried with the path you asked and it works. Thank you.

Long answer:

C# interactive wasn't working when I tried to run it via bash because I hadn't defined MONO_PATH in my .bashrc, so it couldn't find mscorlib. Then it still didn't work in bash because macOS Catalina doesn't use bash anymore, but zsh, so I defined MONO_PATH in .zshrc and it finally worked in Terminal. Then it didn't work in Rider, I suspect it has something to do with zsh.

The path detected automatically by Rider is /Unity.app/Contents/MonoBleedingEdge, there is a "cshap.exe" in MonoBleedingEdge/lib/mono/4.5/, so I tried that and it worked. BUT it doesn't work when I try to run it in Terminal, I get a "Runtime critical type System.RuntimeType not found"... ...anyway, whatever, it works in Rider.

0

Please sign in to leave a comment.