I get the error saying that the type initializer for threw an exception when trying to useMATLAB dll in visual studio. How to solve it?

조회 수: 6 (최근 30일)
Dear experts, I'm trying to use matlab function in visual studio. After I build the dll files, I have a problem to run it in visual studio.
This is the main part of my code: using System.Threading.Tasks;
using System.Windows.Forms;
using MathWorks.MATLAB.NET.Utility;
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.WebFigures;
using DotNetProjectNative;
using DotNetProject;
using showImage;
using showImageNative;
namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e)
{
showImage.Class1 t = new showImage.Class1();
t.showimage(openFileDialog1.FileName);
}
}
}
This is the error: {"The type initializer for 'showImage.Class1' threw an exception."}

답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Microsoft .NET에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by