调用matlab dll报错,c#调用MATLAB的dll时出错
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时出错相关推荐
- C#调用dll报错:无法加载dll,找不到指定模块
最近在做一个swmm模型的项目,在swmm源码上进行改写了两个函数,结果调用的时候就报错了,C#报错之说找不到指定模块,就是不说具体问题,在网上排查了很久,在这里记录一下. 如果确定自己的dll函数 ...
- mfc socket onreceive函数不被调用_不报错地调用空指针类的成员函数
猜猜下列例子运行会有什么结果? class A {public:static void print(){printf(">>>>>n");}void ...
- 启动虚拟机报错:.vmss”还原虚拟机状态时出错。 错误导致继续运行操作失败。请保留挂起状态并纠正错误,或放弃挂起状态。
错误提示: xxx.vmss"还原虚拟机状态时出错. 错误导致继续运行操作失败.请保留挂起状态并纠正错误,或放弃挂起状态. 解决办法: 点击"放弃",重启即可.
- C++调用matlab dll报错:Invalid input:Null runtime instance
一.报错截图如下: 二.操作过程如下: 1.先是使用vs2015打开了vs2017的C++工程,编译运行后没有异常出现: 2.后再用vs2017打开工程,执行调用matlab的函数时报如上错误. 三. ...
- C# 调用NationalInstruments的dll报错问题 未能加载文件或程序集
C# 调用NationalInstruments的dll报错问题 问题原因:dll版本不匹配导致的,需要做如下操作解决问题 未能加载文件或程序集"NationalInstruments.Co ...
- java调用oracle过程,JAVA调用ORACLE存储过程报错
当前位置:我的异常网» Java Web开发 » JAVA调用ORACLE存储过程报错 JAVA调用ORACLE存储过程报错 www.myexceptions.net 网友分享于:2015-07-1 ...
- 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 ...
- 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 ...
- 【报错解决】matlab报错:缺少动态链接库VCOMP100.DLL
问题分析: matlab报错:缺少动态链接库VCOMP100.DLL 在编译某mexw64文件时可能出现. 原因:windows10版本的C:\Windows\System32目录下动态链接库已经是V ...
最新文章
- static构造函数的运行
- 【分享】程序的开发与编写
- java map集合遍历方法,Java的Map集合的三种遍历方法
- 函授计算机与科学论文,函授计算机科学与技术论文
- 【快乐水题】594. 最长和谐子序列
- 【收集】前端技能知识图谱
- 终端编译opengl程序编译运行_ubuntu编译opengl和demo之二(glfw版本)
- 流畅的Python 5. 函数
- LeetCode 519. 随机翻转矩阵(哈希)
- 二分法查找的JAVA程序
- Oracle用户密码过期的处理方法
- 2021高考河北省艺术类成绩查询,2021河北省艺术类高考专业考试成绩有关规定
- 迅雷对非会员进行下载限速的解决方案
- 麒麟服务器操作系统V4,银河麒麟服务器操作系统V4
- 计算机三级考试 信息安全,计算机三级考试《信息安全技术》练习题及答案
- android 分区 加密软件,VeraCrypt(硬盘分区加密软件)
- BZOJ3772精神污染
- MATLAB--数字图像处理 车牌识别之分离字符
- Camunda流程引擎及表结构认识
- 软工网络15团队作业7——Alpha冲刺之事后诸葛亮
热门文章
- 前端进阶之路——域名(domain)
- java host头攻击漏洞_Java Web项目漏洞:检测到目标URL存在http host头攻击漏洞解决办法...
- 计算机在电气中的应用,阐释计算机技术在电力系统中的应用
- 交友项目【动态点赞动态喜欢】
- Codeforces 103B - Cthulhu(并查集 找环和块)
- DL380 Gen7 ILO无法进入,报错。解决一例。
- QQ右下角图标不见了
- 三种网站设计思维促进客户成交
- AntV-G6:画直角树形图
- http://www.jianshu.com/p/55458caf0814