Program Fails to Start with an Exception Message
1. The MCR instance could not be initialized
segv – SEVERE ERROR
System.TypeInitializationException: The type initializer for ‘Algorithms.CompGeometry’ threw an exception. —> System.Exception: The MCR instance could not be initialized —> System.ApplicationException: The MCR instance could not be initialized
segv – SEVERE ERROR at MathWorks.MATLAB.NET.Utility.MWMCR..ctor(String componentId, String componentPath, Stream embeddedCtfStream, Boolean isLibrary) — End of inner exception stack trace — at MathWorks.MATLAB.NET.Utility.MWMCR..ctor(String componentId, String componentPath, Stream embeddedCtfStream, Boolean isLibrary) at Algorithms.CompGeometry..cctor() |
- Possible solution
-
- Remove Matlab cache folder. The folder, by default it is at %AppData%\Local\Temp\<username>\mcrCache7.17
- mcrCache7.17 may be named differently depending on the installed version of Matlab compiler runtime
- This is how you can find the %AppData% folder on your machine.
- If problem still persists, try changing Matlab cache location
- Create a directory where the location is writable, for example create C:\mcrcache
- Go to Control Panel -> System -> Advanced System Settings -> Environment Variables
- Under System variables, add variable name MCR_CACHE_ROOT with the directory path created on the first step as its value
- Remove Matlab cache folder. The folder, by default it is at %AppData%\Local\Temp\<username>\mcrCache7.17
I’m the Benevolent Dictator for Life for MiTS Software cum Editor of this website. Read more here.
You can also contact me at soonhui@mes100.com