how do you specify which version of .NET is used

조회 수: 18 (최근 30일)
Cam Taylor
Cam Taylor 2020년 10월 23일
댓글: Arpit Bhatia 2020년 11월 2일
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에서 Getting 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