Hi @James Clark , sorry about that I don't familiar with C#. But after researched, this error may occurred when the script have something wrong. Please refer to this thread:
Check the
InnerException
property of theTypeInitializationException
; it is likely to contain information about the underlying problem, and exactly where it occurred.