Why do I get the error "Could not load file or assembly 'MWArray'" when deploying a 32-bit C# application created using MATLAB Builder NE 3.0.2 (R2009b) on a 64-bit Windows?
3 次查看(过去 30 天)
显示 更早的评论
I have created a C# application on a 32-bit Windows machine that uses a 32-bit Builder NE component. The application works fine on the development machine.
Now I want to deploy the application on a 64-bit Windows on which I installed the 32-bit version of the MCR.
When I run the application, I get the following error:
Could not load file or assembly 'MWArray, Version=2.9.1.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f' or one of its dependencies. The system cannot find the file specified.
采纳的回答
MathWorks Support Team
2010-1-25
Applications created from C# are compiled as managed code, which makes them platform independent (like Java, for example). Thus, when you compile a C# application on a 32-bit machine and then deploy it on a 64-bit machine, it will, by default, try to run as a 64-bit application. Then, it will try to find the 64-bit version of the MWArray.dll, and if it fails, the mentioned error will be shown.
To work around this issue, set the option "Properties -> Build -> Platform target" to "x86" instead of "Any CPU" before compiling your C# application. This will have the effect that the application will start in 32-bit mode on the 64-bit machine.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Compiler SDK 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!