I want to use a method of a static class.
This is my C# code:
namespace SomeNamepace
{
public struct SomeStruct
{
....
}
public static class SomeClass
{
public static double SomeMethod
{
....
}
}
If it was a "normal" class I could use SomeMethod
like
lib = clr.AddReference('c:\TestModule.dll')
from System import Type
type1 = lib.GetType('SomeNamespace.SomeClass')
constructor1 = type1.GetConstructor(Type.EmptyTypes)
my_instance = constructor1.Invoke([])
my_instance.SomeMethod()
But when trying to do this with the static class I get
MissingMethodException: "Cannot create an abstract class.
How could I solve this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…