作成した .NET アセンブリを C# アプリケーションで使用する際に "Type initializer throws an exception" エラーが出るのはなぜですか?
12 views (last 30 days)
Show older comments
MathWorks Support Team
on 26 Feb 2018
Answered: MathWorks Support Team
on 26 Feb 2018
MATLAB Compiler SDK を使用して .NET アセンブリを作成し、それを C# アプリケーションで使用します。C# 開発環境において、このアセンブリをインスタンス化する際に "Type initializer throws an exception" というエラーとなり、アセンブリを使用することができません。
Accepted Answer
MathWorks Support Team
on 26 Feb 2018
これは MATLAB Compiler SDK により作成された .NET アセンブリのビットと、C# アプリケーションのビットが異なっていることが原因です。
C# アプリケーションのプロジェクト内の「ビルド > プラットフォームターゲット」でビット(x64/x86)をあわせていただけますようお願いいたします。例えば MATLAB (及びMATLAB Compiler SDK)が 64-bit 版のときはここを x64 にします。
0 Comments
More Answers (0)
See Also
Categories
Find more on 配布されたアプリケーション in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!