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)

在 System.Windows.Forms.Button.WndProc(Message& m)

在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)

在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)

在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)

在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)

在 System.Windows.Forms.Application.Run(Form mainForm)

在 WindowsFormsApplication1.Program.Main() 位置 f:\c#\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:行号 19

在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)

在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)

在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()

在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)

在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

在 System.Threading.ThreadHelper.ThreadStart()

InnerException: System.TypeInitializationException

HResult=-2146233036

Message=“MathWorks.MATLAB.NET.Utility.MWMCR”的类型初始值设定项引发异常。

Source=ceshi

TypeName=MathWorks.MATLAB.NET.Utility.MWMCR

StackTrace:

在 ceshi.Class1..cctor()

InnerException: System.TypeInitializationException

HResult=-2146233036

Message=“MathWorks.MATLAB.NET.Arrays.MWArray”的类型初始值设定项引发异常。

Source=MWArray

TypeName=MathWorks.MATLAB.NET.Arrays.MWArray

StackTrace:

在 MathWorks.MATLAB.NET.Utility.MWMCR..cctor()

InnerException: System.BadImageFormatException

HResult=-2147024885

Message=试图加载格式不正确的程序。 (异常来自 HRESULT:0x8007000B)

Source=MWArray

StackTrace:

在 MathWorks.MATLAB.NET.Arrays.MWArray.mclmcrInitialize2(Int32 primaryMode)

在 MathWorks.MATLAB.NET.Arrays.MWArray..cctor()

InnerException:

有朋友知道吗???

调用matlab dll报错,c#调用MATLAB的dll时出错相关推荐

  1. C#调用dll报错:无法加载dll,找不到指定模块

    最近在做一个swmm模型的项目,在swmm源码上进行改写了两个函数,结果调用的时候就报错了,C#报错之说找不到指定模块,就是不说具体问题,在网上排查了很久,在这里记录一下. 如果确定自己的dll函数 ...

  2. mfc socket onreceive函数不被调用_不报错地调用空指针类的成员函数

    ​猜猜下列例子运行会有什么结果? class A {public:static void print(){printf(">>>>>n");}void ...

  3. 启动虚拟机报错:.vmss”还原虚拟机状态时出错。 错误导致继续运行操作失败。请保留挂起状态并纠正错误,或放弃挂起状态。

    错误提示: xxx.vmss"还原虚拟机状态时出错. 错误导致继续运行操作失败.请保留挂起状态并纠正错误,或放弃挂起状态. 解决办法: 点击"放弃",重启即可.

  4. C++调用matlab dll报错:Invalid input:Null runtime instance

    一.报错截图如下: 二.操作过程如下: 1.先是使用vs2015打开了vs2017的C++工程,编译运行后没有异常出现: 2.后再用vs2017打开工程,执行调用matlab的函数时报如上错误. 三. ...

  5. C# 调用NationalInstruments的dll报错问题 未能加载文件或程序集

    C# 调用NationalInstruments的dll报错问题 问题原因:dll版本不匹配导致的,需要做如下操作解决问题 未能加载文件或程序集"NationalInstruments.Co ...

  6. java调用oracle过程,JAVA调用ORACLE存储过程报错

    当前位置:我的异常网» Java Web开发 » JAVA调用ORACLE存储过程报错 JAVA调用ORACLE存储过程报错 www.myexceptions.net  网友分享于:2015-07-1 ...

  7. python调用dll报错:ValueError: Procedure called with not enough arguments (4 bytes missing) or wrong call

    python调用dll报错:ValueError: Procedure called with not enough arguments (4 bytes missing) or wrong call ...

  8. c# 传递Null的string值导致的调用C++的dll报错 Attempted to read or write protected memory.

    c# 调用C++的dll报错 Attempted to read or write protected memory: 原因是:c# 传递Null的string值导致的,将Null改为string.e ...

  9. 【报错解决】matlab报错:缺少动态链接库VCOMP100.DLL

    问题分析: matlab报错:缺少动态链接库VCOMP100.DLL 在编译某mexw64文件时可能出现. 原因:windows10版本的C:\Windows\System32目录下动态链接库已经是V ...

最新文章

  1. static构造函数的运行
  2. 【分享】程序的开发与编写
  3. java map集合遍历方法,Java的Map集合的三种遍历方法
  4. 函授计算机与科学论文,函授计算机科学与技术论文
  5. 【快乐水题】594. 最长和谐子序列
  6. 【收集】前端技能知识图谱
  7. 终端编译opengl程序编译运行_ubuntu编译opengl和demo之二(glfw版本)
  8. 流畅的Python 5. 函数
  9. LeetCode 519. 随机翻转矩阵(哈希)
  10. 二分法查找的JAVA程序
  11. Oracle用户密码过期的处理方法
  12. 2021高考河北省艺术类成绩查询,2021河北省艺术类高考专业考试成绩有关规定
  13. 迅雷对非会员进行下载限速的解决方案
  14. 麒麟服务器操作系统V4,银河麒麟服务器操作系统V4
  15. 计算机三级考试 信息安全,计算机三级考试《信息安全技术》练习题及答案
  16. android 分区 加密软件,VeraCrypt(硬盘分区加密软件)
  17. BZOJ3772精神污染
  18. MATLAB--数字图像处理 车牌识别之分离字符
  19. Camunda流程引擎及表结构认识
  20. 软工网络15团队作业7——Alpha冲刺之事后诸葛亮

热门文章

  1. 前端进阶之路——域名(domain)
  2. java host头攻击漏洞_Java Web项目漏洞:检测到目标URL存在http host头攻击漏洞解决办法...
  3. 计算机在电气中的应用,阐释计算机技术在电力系统中的应用
  4. 交友项目【动态点赞动态喜欢】
  5. Codeforces 103B - Cthulhu(并查集 找环和块)
  6. DL380 Gen7 ILO无法进入,报错。解决一例。
  7. QQ右下角图标不见了
  8. 三种网站设计思维促进客户成交
  9. AntV-G6:画直角树形图
  10. http://www.jianshu.com/p/55458caf0814