I want to compile some Matlab code in Matlab Builder NE.
In this code, I want to call .NET assemblies, using Matlab built-in ability to use .NET components : http://www.mathworks.com/help/techdoc/matlab_external/brpb58s-1.html
The process is like that:
- C# calls Matlab compiled .NET DLL
- MCR uses .NET assemblies to do something (As described above)
- MCR returns answer to C#
Here is a Matlab code sample that is being compiled to .NET component, with .NET4 as target
function ver = GetVersion()
NET.addAssembly('System');
ver = char(System.Environment.Version.ToString())};
end
However, when this simple code is compiled, by taking a look at ver,I am realizing that it uses .NET 2 instead of .NET 4.
When I use it directly from Matlab, I get version 4.
How can I control the .NET runtime version in compiled DLLs?