C# MatlabDLL在C.NET中使用时引发异常
我正在做一个需要曲线拟合的项目。为了获得最佳效果,我选择使用MatlabToolkit。我为这段代码创建了一个dll,并尝试在C.NET框架中使用它。dll可以在一个系统上成功运行,但不能在任何其他系统上运行。 我得到以下例外情况:C# MatlabDLL在C.NET中使用时引发异常,c#,.net,dll,matlab,C#,.net,Dll,Matlab,我正在做一个需要曲线拟合的项目。为了获得最佳效果,我选择使用MatlabToolkit。我为这段代码创建了一个dll,并尝试在C.NET框架中使用它。dll可以在一个系统上成功运行,但不能在任何其他系统上运行。 我得到以下例外情况: Unhandled Exception: System.TypeInitializationException: The type initializer fo r 'curve.cfit' threw an exception. ---> System.Ty
Unhandled Exception: System.TypeInitializationException: The type initializer fo
r 'curve.cfit' threw an exception. ---> System.TypeInitializationException: The
type initializer for 'MathWorks.MATLAB.NET.Utility.MWMCR' threw an exception. --
-> System.TypeInitializationException: The type initializer for 'MathWorks.MATLA
B.NET.Arrays.MWArray' threw an exception. ---> System.DllNotFoundException: Unab
le to load DLL 'mclmcrrt7_17.dll': The specified module could not be found. (Exc
eption from HRESULT: 0x8007007E)
at MathWorks.MATLAB.NET.Arrays.MWArray.mclmcrInitialize2(Int32 primaryMode)
at MathWorks.MATLAB.NET.Arrays.MWArray..cctor()
--- End of inner exception stack trace ---
at MathWorks.MATLAB.NET.Utility.MWMCR..cctor()
--- End of inner exception stack trace ---
at curve.cfit..cctor()
--- End of inner exception stack trace ---
at curve.cfit..ctor()
我想知道为什么会发生这种情况,以及我如何解决这个问题?我需要在多台机器上部署我的项目。我该怎么办
提前感谢:错误告诉您程序找不到mclmcrrt7_17.dll。这是MATLAB编译器运行时的一部分,您需要在每个目标机器上部署它。看起来您尚未部署MATLAB编译器运行时 运行时可再发行文件在以下位置可用: