System.Typ​eInitializ​ationExcep​tion thrown initialising a MWNumericArray

6 次查看(过去 30 天)
I am trying to use in VS 2013 a .NET assembly made in MATLAB R2014a 64-bit, but a System.TypeInitializationException is thrown in correspondence of the following C# line: F = new MWNumericArray(3, 3, 3); My OS is Windows 8.1 64-bit. Can anyone help me?

采纳的回答

Nidhi Jain
Nidhi Jain 2014-7-14
Hi Emanuele,
This looks like a 32bit-64bit mismatch issue. Please make sure that the platform selected in Visual Studio is 64-bit “x64”. If you do not have that option, try to add it using:
1. Open the project that you want to configure.
2. Open the property pages for that project.
3. Choose the Configuration Manager button to open the Configuration Manager dialog box.
4. In the Active Solution Platform drop-down list, select the <New…> option to open the New Solution Platform dialog box.
5. In the Type or select the new platform drop-down list, select a 64-bit platform.
Note: In the New Solution Platform dialog box, you can use the Copy settings from option to copy existing project settings into the new 64-bit project configuration.
6. Choose the OK button. The platform that you selected in the preceding step appears under Active Solution Platform in the Configuration Manager dialog box.
If the “64-bit” platform option is not available in the <New..> platform option, try the following:
1. Open Control Panel -> Uninstall or Change Programs
2. Select the appropriate version of Microsoft Visual Studio. Right lick and select “Uninstall/Change”
3. A window will open up, click on “Next” once the setup is completed.
4. Click on “Add/Remove features”
5. Expand the “Visual C++” option and make sure to check “x64 Compiler and Tools”
This should add the x64 option to Visual Studio.
  2 个评论
NEETHU PRAKASH
NEETHU PRAKASH 2016-12-15
hi, I also have the same problem.Till now it shows the System.Type Initialization Exception error.My system is windows 10.I can't done the steps given by Nidhi Jain.Actually i want to run .net dll file created using matlab 2014a.I need help. Thanks in advance.....

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Just for fun 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by