Question about Reflection

Hi there,

I'm searchin for a possibility to code the following scenario: My project includes a JScript-Sourcefile (The main project is a Windows Forms app written in C#). I'd like to dynamically compile the JS-File, execute it and can ideally referencing objects from my project.

Question to you experts: Is this possible Can you point me to any good links, which contains ideally coding samples

Thanks in advance

Reiner



Answer this question

Question about Reflection

  • pc-coholic

    Noah,

    sorry, but I better post this question in the forum for the "big" framework. Posting it to this NG has been inadvertent!

    best regards and thank you!

    Reiner


  • PeterMa

    Well I see two issues so far, one is that I am not aware of a JScript compiler which will run on a winCE smart device (I assume that is where you want this app to run ) and the other is that NetCF only has support for binaries generated by the C# and VB compilers so the compiled JScript probably wouldn't work if you had it.

    To get around the dynamic compilation you could create some sort of dynamic compilation web service where you send out your source code and get back the compiled binary. Another option would be to get the compiled binary from wherever you were getting the JS file in the first place.

    To get around the JScript part though you would need to select a language that is supported by Net CF. (The JScript binary might actually work against NetCF if it needs no special language support libraries and no IL opcodes that we don't support, but this would definately fall in the unsupported scenarios if it even worked at all)

    Potentially you get around both issues by wrinting a JScript interpreter (which would use reflection to late bind everything), but I am guessing that is far too much work.

    -Noah Falk

    .Net Compact Framework


  • Question about Reflection