Yes, it is possible if the method does not use this because the CLR does not perform a null check for call statements.
You will need to manually modify IL, since the C # compiler almost always generates a callvirt 1 command.
See this blog and example for more details:
Instance Methods Called by Null References
Example
.method private hidebysig static void Main(string[] args) cil managed { .entrypoint
1 In fact, the reason the C # compiler emits a callvirt even when a simple call instruction is sufficient is to prevent instance methods from being called to null references. With this behavior of the compiler, users will get a NullReferenceException , so they avoid the strange situation of calling a method on a null pointer. Eric Gunnerson explained this on a blog a while ago: Why does C # always use callvirt? Gishu also has a nice explanation in a related question .
Dirk vollmar
source share