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?

4 ビュー (過去 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 Center および File ExchangeDeploy to .NET Applications Using MWArray API についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by