NullGuard for throwing more informative exceptions This small utility class is my solution for a more convenient way for checking against null. I also wanted to have more informative NullReferenceExceptions but I didn't want to pollute my code with null checks everywhere.
static class NullGuard
{
    public static T Check&lt;T&gt;(Expression&lt;Func&lt;T&gt;&gt; expr) where T : class
    {
        T value = expr.Compile()();
        if (value == null)
        {
            var message = CreateMessage(expr.Body);
            throw new NullReferenceException(message);
        }        
        return value;
    }
    
    private static string CreateMessage(Expression expr)
    {
        return CreateMessage(expr as MemberExpression) ?? CreateMessage(expr as MethodCallExpression);
    }
    
    private static string CreateMessage(MemberExpression expr)
    {
        if (expr == null)
        {
            return null;
        }
        
        string instanceName = null;
        
        var constantExpression = expr.Expression as ConstantExpression;
        if(constantExpression != null)
        {
            instanceName = &quot;this&quot;;
        }
        
        var memberExpression = expr.Expression as MemberExpression;
        if (memberExpression != null)
        {
            instanceName = memberExpression.Member.Name;
        }

        return CreateMessage(expr.Member.Name, expr.Member.MemberType.ToString(), instanceName);
    }    
    
    private static string CreateMessage(MethodCallExpression expr)
    {        
        string instanceName = null;
        var newExpression = expr.Object as NewExpression;
        if (newExpression != null)
        {
            instanceName = &quot;new &quot; + newExpression.Constructor.DeclaringType.Name;                
        }
        
        var constantExpression = expr.Object as ConstantExpression;
        if (constantExpression != null)
        {
            instanceName = &quot;this&quot;;
        }
        
        var memberExpression = expr.Object as MemberExpression;
        if (memberExpression != null)
        {
            instanceName = memberExpression.Member.Name;
        }
        return expr == null ? null : CreateMessage(expr.Method.Name, expr.Method.MemberType.ToString(), instanceName);
    }
    
    private static string CreateMessage(string memberName, string memberType, string declaringType)
    {
        var message = string.Format(
            &quot;{0}.{1} (Instance.{2})&quot;, 
            declaringType,
            memberName, 
            memberType);
        return message;
    }
}

Its usage should be just on single methods or properties that must not be null but if they are, I want to know exactly where the null occurred:
class Foo 
{ 
    public string Bar { get; set; } 
    public string Baz() { return null; }
}

void Main()
{
    string abc = null;
    var foo = new Foo();
        
    //NullGuard.Check(() =&gt; abc);    
    //NullGuard.Check(() =&gt; foo.Bar);
    //NullGuard.Check(() =&gt; foo.Baz());
    //NullGuard.Check(() =&gt; new Foo().Baz());
    NullGuard.Check(() =&gt; qux());
}

string qux() { return null; }

Result:

foo.Bar (Instance.Method)
foo.Baz (Instance.Property)
this.qux (Instance.Property)
Using a NullReferenceException for this seems wrong since no null reference has been dereferenced - it's capturing expressions which return null when they are not expected to. An InvalidOperationException might fit better (since you are performing an operation on an object which is in an invalid state) or even your own InvalidNullReturnException.
You can greatly simplify your message generation with:

var message = expr.Body.ToString();


This dumps the passed in expression as a string and you don't have to try and handle all kinds different expressions yourself.
Overall I would probably opt for aspect oriented programming (AOP) instead of littering my code with these NullGuard calls. There are a whole number of AOP frameworks around which usually work by using attributes you can decorate your methods and properties with. Based on these attributes arbitrary code can be injected - in your case you could inject the null checking and throwing code. This seems a much less intrusive way of achieving this kind of functionality greatly enhancing readability.