If you are trying to compile Matlab into .Net framework, you might encounter this message, even though you have the .Net framework installed:
Invalid .NET Framework. Either the specified framework was not found or is not currently supported.
This error is very misleading, because most of the time, developers are smart enough to install .Net framework before trying to compile Matlab library into .Net component. The reason why-- despite that you already have .Net framework installed-- this message comes up is because of the way you specify your mcc build compilation parameter.
'mcc -d ' dnetdir ' -W ''dotnet:dotnet,dotnetclass,1.0,private'' -T link:lib ' mfile
The above command won't work if you don't have .Net framework 1.0 installed. This is because Matlab allows you to specify the .Net framework version (1.0) after you specify your class name(dotnetclass). And by setting the value to be 1.0 you are compiling against .Net framework 1.0 which simply doesn't exist on modern developer machine.
4 comments:
The world is really small, I started reading your blog a year ago and I was surprised to meet you again on stackoverflow/Matlab a couple of days ago.
Are you doing this matlab stuff on work or are you studying?
Mikhail
For fun.
hi everybody,
i would like you te help me,
i have a to creata .Net dll with matlab to use it in a c# application in visual studio
after using
mcc -W 'dotnet:test,test,4,0,private' -d 'C:\Documents and Settings\ijlal\Mes Documents\Matlab\test\src' -T 'link:lib' -v 'class{test:C:\Documents and Settings\ijlal\Mes Documents\Matlab\somme.m}'
i have this error:
Invalid .Net Framework
Either the specified framework was not found or is not currently supported.
??? Error using ==> mcc
Error executing mcc, return status = 1 (0x1).
does anyone have an idea to fix that problem??
thank you
i forgot to mentien that i have .Net Framework 4.0 intalled
and the command is
mcc -W 'dotnet:test,test,4.0,private' ......
not
mcc -W 'dotnet:test,test,4,0,private' ......
Post a Comment