Why am I getting a MissingMethodException when using a Script# assembly from another .NET assembly?

戏子无情 提交于 2019-12-12 02:12:39

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!