问题
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?
来源:https://stackoverflow.com/questions/11459579/why-am-i-getting-a-missingmethodexception-when-using-a-script-assembly-from-ano