how do you specify which version of .NET is used

28 vues (au cours des 30 derniers jours)
Cam Taylor
Cam Taylor le 23 Oct 2020
Commenté : Arpit Bhatia le 2 Nov 2020
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?

Réponses (1)

Arpit Bhatia
Arpit Bhatia le 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 commentaires
Cam Taylor
Cam Taylor le 28 Oct 2020
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 le 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.

Connectez-vous pour commenter.

Tags

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by