Unhandled exception - An error occurred trying to start process when using .NET CLI in VS Code snap on Ubuntu

I install VS Code in Ubuntu using snap. This has generally been fine, but with the new-ish dotnet run app.cs , I hit an interesting problem. When I try to run some .NET CLI applications using a terminal within VS Code, I get an error that looks like this - Unhandled exception: An error occurred trying to start process…