Why am I getting a MissingMethodException when usi

2019-09-01 03:24发布

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?

标签: script#
1条回答
三岁会撩人
2楼-- · 2019-09-01 04:26

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?

查看更多
登录 后发表回答