-->

Why am I getting a MissingMethodException when usi

2019-09-01 04:07发布

问题:

I'm testing Script# right now and created a simple Script# class library with a single class.

The class has a method that does something like this:

public static string[] SplitName(string name)
{
    return name.Split(' ');
}

It compiles fine and generates the JS output file but when I reference this assembly from my NUnit project and try to test it a MissingMethodException is thrown.

System.MissingMethodException : Method not found 'System.String[] System.String.Split(Char)'.

What am I doing wrong?

回答1:

Remember that even when it is a valid .net assembly, it references a custom mscorlib.dll. See my answer to your other question to see the way I do it. Is it possible to write code in C# and use Script# to share it between .NET assemblies and JavaScript?



标签: script#