MATLAB是2014a,VS是2013的。
在C#中调用matlab生成的dll文件时,ceshi.Class1 yaoyi = new Class1(); 对类进行实例时,抛出异常。异常为:
未处理System.TypeInitializationException
HResult=-2146233036
Message=“ceshi.Class1”的类型初始值设定项引发异常。
Source=ceshi
TypeName=ceshi.Class1
StackTrace:
在 ceshi.Class1..ctor()
在 WindowsFormsApplication1.Form1.button1_Click(Object sender, EventArgs e) 位置 f:\c#\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs:行号 33
在 System.Windows.Forms.Control.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnClick(EventArgs e)
在 System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ButtonBase.WndProc(Message& m)