Static Code Analysis

These days I’ve been updating the CA settings on some old projects, I wanted to modify the configuration of certain rules that were removed with the shipping of Visual Studio 2008. You can obtain detailed information about what rules are shipped with each version of CA in this post of the FxCop blog. As you […]

Static Fields

“Types may declare locations that are associated with the type rather than any particular value of the type. Such locations are static fields of the type. As such, static fields declare a location that is shared by all values of the type. Just like non-static (instance) fields, a static field is typed and that type […]

Executing dynamic IL with DynamicMethod

One of the features we have in .NET is the ability to execute IL code generated dynamically, in fact there is a complete namespace to generate code at runtime called System.Reflection.Emit Prior to .NET Framework 2.0 if we wanted to execute the IL code generated we needed to deal with a dynamic assembly making use […]

Inline Methods

Method inlining is an optimization technique that consists of putting the body of a method inside the body of all the caller methods and removing the original method. Let’s suppose the next sample: class Demo { public void Talk() { SayHello(); WaitUserAction(); } private void SayHello() { Console.WriteLine(“Hello!”); } … } To inline the method […]