By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,467 Members | 1,500 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,467 IT Pros & Developers. It's quick & easy.

Jscript Dll with C# program gives Error.

P: n/a
Hi All,

I create Jscript Dll to evaluate string expression in C# program. The
Jscript code :

class JScriptEval
{
function Evaluate(evalString : String)
{
return eval(evalString);
}
}

And compile this Jscript file with the JSC in the .Net to be able to
use it in the C# program.
After that I add the Jscript Dll and Microsoft.Jscrpit dll to the
program as references.
I add button and text box to the form and add this code to the button
click.

private void button1_Click(object sender, System.EventArgs e)
{
ArrayList bb = new ArrayList();
bb.Add("textBox1.Text");
string dd;
int ss;

JScriptEval nn = new JScriptEval();

for(int i = 0 ; i < bb.Count ; i++)
{
dd = (string)bb[i] + ".Length" ;
ss = (int)nn.Evaluate(dd);
}
}

And run the program and then click the button. I get this exception.

"An unhandled exception of type 'System.IO.FileNotFoundException'
occurred in system.windows.forms.dll
Additional information: File or assembly name myeval2, or one of its
dependencies, was not found."

Can anyone help.
Thanks
Bassem
Nov 15 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.