Click here to Skip to main content
15,880,469 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi every one
I am trying to call matlab function in c# project
I followed steps in
http://xinyustudio.wordpress.com/2009/11/12/using-matlab-functions-in-c-2009b/[^]
http://scriptbucket.wordpress.com/2012/07/18/how-to-call-functions-in-a-matlab-generated-net-dll-from-c/[^]

but when I ran c# project I got this Error and warning
"Could not load file or assembly 'MWArray, Version=2.12.1.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f' or one of its dependencies. An attempt was made to load a program with an incorrect format"


"
SQL
Warning 2   There was a mismatch between the processor architecture of the project being built "x86" and the processor architecture of the reference "MWArray, Version=2.12.1.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f, processorArchitecture=AMD64", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.   test_zip

"


my windows is windows 7 64 bit
and I am using visual studio 2010
and matlab 2012b 64 bit


note :
I did all steps on the same computer

Thanks to all
Posted
Updated 12-Sep-13 23:44pm
v2

1 solution

I think you should build both in x64 because your project is x86 and your reference x64

Quote:
Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900