using File.ReadAllText in an object results in error

Dec 7, 2010 at 9:06 PM


I have used engine.SetParameter to add an object that has a function to load text. However when I call the function to load the text using the File.ReadAllText I get an error.

Is there a limitation to jint in doing IO in CSharp? I can call this object's function in CSharp and it works.

I have even tried to use a richtextbox passed to jint and it will not load a file either.


Dec 7, 2010 at 9:54 PM

You actually need to allow CLR calls on the engine, like engine.AllowClr = true. You might also disable the security, or add specific permissions to the engine. There are some examples for it in the documentation section.

Dec 7, 2010 at 10:06 PM

Thanks. That was what i was missing.