New to Telerik JustMock? Start a free 30-day trial
The type initializer for 'Telerik.JustMock.SecuredReflection' threw an exception
Updated on Jan 27, 2026
Description
When JustMock is referenced from the installation folder, it is possible to get the following exception during test run:
System.TypeInitializationException : The type initializer for 'Telerik.JustMock.SecuredReflection' threw an exception. ---- System.IO.FileNotFoundException : Could not load file or assembly 'System.Security.Permissions, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
Solution
Add reference to System.Security.Permissions' nuget package. Target versions greater than 4.0.1.0.