In this part we will try to invoke compiled C# assembly to JScript

DotNet To JScript

first we will get the DotNetToJScript project from GitHub

Untitled

Now let’s open the solution

Untitled

Please notice we have to projects

  1. DotNetToJScript: the code that convert DotNet To JScript code
  2. ExampleAssembly: that is the C# code that we will convert to JScript

Now let’s test this

//This C# code in Example Assembly Solution
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Windows.Forms;

[ComVisible(true)]
public class TestClass
{
    public TestClass()
    {
        MessageBox.Show("Test", "Test", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
    }

    public void RunProcess(string path)
    {
        Process.Start(path);
    }
}

Untitled

Now build the solution

Untitled

Now we got this file

Untitled

Now let’s copy this file to the path that contains the DotNetToJScript.exe

Untitled