how do you specify which version of .NET is used
23 views (last 30 days)
Show older comments
We have a requirement to communicate with our API from Matlab. We have found that it requires much more coding in Matlab to perform a task that we can do with a single line of code by referencing a .NET assembly. Calls which work in every other environment fail with a particular error, that we can replicate by calling the assembly from a .NET4.6.2 targeted application. This is pretty frustrating, and at this point it is a complete roadblock.
I would like to know if there is any way to control the version .NET used by the NET calls?
0 Comments
Answers (1)
Arpit Bhatia
on 28 Oct 2020
Hi Cam,
Please refer to the below MATLAB Answers post on how to specify which version of .NET framework MATLAB uses.
2 Comments
Arpit Bhatia
on 2 Nov 2020
There is nothing in the MATLAB configuration that sets any specific .NET version, it is all picked by the Windows OS.
There are two configurations in .NET, one for the application, and one for the system. You can find the MATLAB configuration file in <matlabroot>/bin/win64/matlab.exe.config. The configuration (in MATLAB) is set to run 4.x.
To specify the version of .NET used, you can try to remove the dependency on MATLAB's configuration file and then check the system configuration file.
1) Temporarily eliminate the MATLAB configuration file as follows:
- Close MATLAB
- Rename the MATLAB.exe.config file to MATLAB.exe.config.backup
2) Edit the system or .NET application configuration files until the issue is resolved. The following link will help with different .NET configuration files, you may want to focus on the machine's configuration:
Note: After you are done with your task, please make sure to rename the file back to its original name.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!