I am trying to start with JSIL . As far as I understand, I followed the directions. I have a very simple C # project with code:
namespace TestLib
{
public class MagicType
{
public int Multiply(int x, int y)
{
return x * y;
}
public static int Add(int x, int y)
{
return x + y;
}
}
}
I compiled this with help jsilcand created a website that hosts this along with jsil scripts. My html initializes this:
<script type="text/javascript">
var jsilConfig = {
libraryRoot: '/js/jsil/',
scriptRoot: '/js/testlib/',
manifestRoot: '/js/testlib/',
manifests: ['TestLib.dll']
};
var asm = null;
var runMain = function () {
console.log('> main');
asm = JSIL.GetAssembly("TestLib", true);
console.log('< main');
};
</script>
<script src="/js/jsil/jsil.js"></script>
but ... I cannot access the library. The console output indicates that it is loading:
Loading '/js/testlib/TestLib.dll.manifest.js'...
which is 200 OK. However, I cannot access it. If I run:
var asm = JSIL.GetAssembly("TestLib", true);
then I return the stub to the library, but there is nothing in it. There is a asm.$typesByName, but it is an empty object. What I want to do (to see it work) is to call methods Multiplyand Add.
: ? , js, , , . . : https://github.com/mgravell/jsilfun