how do you specify which version of .NET is used

23 次查看(过去 30 天)
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?

回答(1 个)

Arpit Bhatia
Arpit Bhatia 2020-10-28
Hi Cam,
Please refer to the below MATLAB Answers post on how to specify which version of .NET framework MATLAB uses.
  2 个评论
Cam Taylor
Cam Taylor 2020-10-28
I presume this response is only for compiled matlab projects? In my particular instance (at least until we can resolve this issue) we're running from within matlab.
Is it possible to do the same within the Matlab environment?
Arpit Bhatia
Arpit Bhatia 2020-11-2
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with Microsoft .NET 的更多信息

标签

产品


版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by