CSharp/C# >> Jscript Dll with C# program gives Error.

by bassembwa » Mon, 09 Feb 2004 18:08:29 GMT

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

Similar Threads

1. Linking C# code to Win32 program (gives LNK4248 error)

Hi,

I am a Win32 programmer. I dont have any exposure to .net technology. I am
developing an application using C, Win32 APIs. I am using Visual studio 2005.
In my application I need to include a code that is in C#.  So I created one .
cs file and included it in my project. Then i wrote a function in .cs file
(GetUSB_Devices()) . I called GetUSB_Devices() from my C code. Now when i try
to compile my program it gives linker error:

1>HW_INIT_BCODE.obj : warning LNK4248: unresolved typeref token (01000011)
for '_HIDP_PREPARSED_DATA'; image may not run
1>usbfunc.obj : error LNK2028: unresolved token (0A000056) "int __cdecl
GetUSB_Devices(void)" (?GetUSB_Devices@@$$FYAHXZ) referenced in function "int
__cdecl GetNumUSBDev(void)" (?GetNumUSBDev@@$$FYAHXZ)
1>usbfunc.obj : error LNK2019: unresolved external symbol "int __cdecl
GetUSB_Devices(void)" (?GetUSB_Devices@@$$FYAHXZ) referenced in function "int
__cdecl GetNumUSBDev(void)" (?GetNumUSBDev@@$$FYAHXZ)  

Please help me to resolve these errors

Thanks & Regards
Abhijeet

2. Project 2007 srchui.dll and jscript.dll error loading Project Guid

3. Changing machine gives XslTransform error (ArithmeticException in mscorlib.dll followed by XsltCompileException in system.xml.dll)

4. Porting from JScript to JScript.Net - compiler error - Asp.Net

5. Error :: compile serilization program given in boost library examples

6. Error :: compile serilization program given in boost library examples

7. Error :: compile serilization program given in boost library examples

8. Deriving from TObject gives access error when exported to another dll - Borland C++ Builder VCL Components