Click here to Skip to main content
15,881,856 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
Hi all!
I am trying to call matlab function in my c# windows form application. I followed all the steps which are given by matthworks for deploying a project. I included
C#
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;


also a reference to the DLL of that function i.e.
using wavrec;;


But when I compile the project it gives the following error
C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:TRACE /reference:"C:\Program Files (x86)\MATLAB\R2006b\bin\win32\MWArray.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Deployment.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /reference:..\..\..\..\MATLAB\NNtrain\wavrec\distrib\wavrec.dll /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\Interface_project.exe /resource:obj\Release\Interface_project.Main.resources /resource:obj\Release\Interface_project.Properties.Resources.resources /resource:obj\Release\Interface_project.TestForm.resources /resource:obj\Release\Interface_project.TrainForm.resources /resource:obj\Release\Interface_project.Training_Patterns.resources /target:winexe Main.cs Main.Designer.cs Program.cs Properties\AssemblyInfo.cs Properties\Resources.Designer.cs Properties\Settings.Designer.cs QuranDataSet.Designer.cs Test.cs Test.Designer.cs Train.cs Train.Designer.cs Training_Patterns.cs Training_Patterns.Designer.cs

c:\Users\Abro\Documents\MATLAB\NNtrain\wavrec\distrib\wavrec.dll: error CS1705: Assembly 'wavrec, Version=0.0.4349.23403, Culture=neutral, PublicKeyToken=null' uses 'MWArray, Version=2.0.0.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f' which has a higher version than referenced assembly 'MWArray, Version=1.0.2415.7148, Culture=neutral, PublicKeyToken=e1d84a0da19db86f'



I am using windows 7, system 64-bit, MATLAB 7.6.0, visual studio 2008

Can any one tell me what can be the problem and how to solve please?
Thanks in advance.
Posted
Updated 4-Feb-17 6:12am

It literally tells you that:
uses 'MWArray, Version=2.0.0.0 .. which has a higher version than referenced assembly 'MWArray, Version=1.0.2415.7148


So you are trying to call a function from a subroutine, that uses a newer function.

The question is, are you using dlls with different versions?
 
Share this answer
 
Comments
[no name] 4-Feb-17 12:20pm    
Too late...2011.. others (beginners like me) would be downvoted for something like this..be sure I do not vote this
Kenneth Haugland 4-Feb-17 15:06pm    
Oops, didnt see that the question was from 2011 :-).
[no name] 5-Feb-17 7:06am    
I have sometimes same Problems (with my glasses) :-)
hi sir

firstly u should add matlab library from reference in vb.net and then u can use ur code

for more information about how to call matlab function in vb.net visit

www.mathwork.com and search about call matlab function in vb.net
 
Share this answer
 

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