Exception MWArray assembly failed to be initialized

I have a .Net DLL created from Matlab Compiler SDK. I created a simple .Net application around it to test proper input and output. This application works as expected. When I try to integrate the library using the same wrapper class into a larger application, I get the following exception:
{"MWArray assembly failed to be initialized"}
{"StartIndex cannot be less than zero.\r\nParameter name: startIndex"}
at Render..ctor()
at Display_Software.Render..cctor() in C:\Users\user\Documents\display\Display Software\Render.cs:line 81
The type initializer for 'Display_Software.Render' threw an exception.
The simple application works fine in console or window mode and with .Net 4.5.2 or 4.6.1. Both apps are referencing the same MWArray.dll.
Any ideas what could be different between the two projects to cause this error?

2 件のコメント

Zac Drake
Zac Drake 2016 年 9 月 12 日
After further debugging is appears that assembly.location is returning an empty string in the larger project while it is returning the expected value in the simple wrapper.
Vesa Maunula
Vesa Maunula 2019 年 11 月 18 日
So, how to fix this?

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeC Shared Library Integration についてさらに検索

タグ

質問済み:

2016 年 9 月 12 日

コメント済み:

2019 年 11 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by