Enabling line-level timings for SecurityTransparent code
Published 05 December 2012
ANTS Performance Profiler will not show line-level profiling results for methods from any module marked as SecurityTransparent (or, in .NET 3.5 and earlier, marked as partially trusted). ANTS Performance Profiler shows method-level timings for these methods, even if you have selected a line-level profiling mode.
To enable line-level timings for SecurityTransparent or partially trusted modules, modify the assembly and then profile the application again:
- Remove the AllowPartiallyTrustedCallers attribute from the profiled assembly and from any of its dependencies.
- Increase the code's trust level:
- In .NET 4: Set the application's code to SecurityCritical or SecuritySafeCritical mode. (This requires the code to have full trust.)
For instructions on setting these attributes, see SecurityCriticalAttribute Class or SecuritySafeCriticalAttribute Class(MSDN).
- In .NET 3.5 and earlier: Set the application's code trust level to FullTrust.
For details, see Named Permission Sets (MSDN).
- In .NET 4: Set the application's code to SecurityCritical or SecuritySafeCritical mode. (This requires the code to have full trust.)
- Rebuild and profile the application again.