Avoid calling problematic methods
Avoid making unnecessary and potentially dangerous method calls.
This rule fires when a member calls one of the following methods:
Calling GC.Collect can seriously impact application performance and is very rarely necessary. For more information, see the Rico Mariani's Performance Tidbits blog entry on MSDN.
Thread.Suspend and Thread.Resume have been deprecated because of their unpredictable behavior. Use other classes in the System.Threading namespace, such as Monitor, Mutex Mutex, and Semaphore , to synchronize threads or protect resources.
The DangerousGetHandle method poses a security risk because it can return a handle that is not valid. See the DangerousAddRef and the DangerousRelease methods for more information about using the DangerousGetHandle methodsafely
These methods can load assemblies from unexpected locations. For example, see Suzanne Cook's .NET CLR Notes blog posts LoadFile vs. LoadFrom and Choosing a Binding Context on the MSDN website for information about methods that load assemblies.
By the time the user code starts executing in a managed process, it is too late to reliably call CoSetProxyBlanket. The CLR takes initialization actions that may or may not prevent the users P/Invoke from succeeding.
If you do need to call CoSetProxyBlanket for a managed application, we recommend that you start the process using a native code (C++) executable, call CoSetProxyBlanket in the native code, and then start your managed code application in process. (Be sure to specify a runtime version number.)