Can’t debug a game with MoonSharp any more

I’m running into problems using MoonSharp (the Lua interpreter) and Unity. I don’t normally use C# or Visual Studio (or Unity), so it’s kind of a mystery why things have broken.

About a year ago, I used MoonSharp to work on a prototype. This used Unity 2019.1.1f1, and I was able to read game data from Lua. I am now working on a new prototype, with Unity 2019.3.12f1. MoonSharp is working fine when I run in Unity. But when I try to use Visual Studio (for macOS) and set a breakpoint, it looks like C# is not recognizing things.

This all works fine with the older Unity! (In other words, being able to set a breakpoint in Visual Studio depends on whether I am launching Visual Studio from 2019.1 or 2019.3.)

When Visual Studio tries to build the app, it doesn’t recognize using MoonSharp.Interpreter (complaining there may be a missing assembly reference). When Unity runs the app, this works fine. MoonSharp is in the Assets/Plugin folder.

Did you get MoonSharp from the Asset store or somewhere else? I’m using MoonSharp in 2019.3.11 currently without issue (Also on a Mac). It’s probably just some weirdness with Visual Studio. What happens if you open Visual Studio by double clicking a script from Unity for example?

I’m using this moonsharp, probably the same one Praetor is mentioning:

I did not test extensively but it certainly seems to work in Unity 2019.3.5f1