I'm getting an exception when trying to call Enum.Parse from within a script hosted via ClearScript
Error
Error: The non-generic method 'System.Enum.Parse(System.Type, string)' cannot be used with type arguments
--- Script error details follow ---
Error: The non-generic method 'System.Enum.Parse(System.Type, string)' cannot be used with type arguments
at translateParameterValue (Script [temp]:11:27) -> return clr.System.Enum.Parse(app.MyLibrary.MyEnum, value);
Script
return clr.System.Enum.Parse(app.MyLibrary.MyEnum, value);
I'm pretty sure I registered the clr
object correctly (this contains mscorlib
, System
and System.Core
)
It seems ClearScript is trying to invoke and is getting confused whether to make the first parameter app.MyLibrary.MyEnum
a generic parameter or pass it as a System.Type
parameter.
Question
What can I do to correctly invoke System.Enum.Parse
function given this scenario?