dimanche 26 avril 2015

I have C# 5.0 and .NET 4.5. Why can't I find CallerMemberName?


In Visual Studio, it can't find Caller Member, even though I have the correct versions. What should I do to fix this?

using System.Runtime.CompilerServices; 

public static void Bug([CallerMemberName] string callingFunction = null)
    if (callingFunction != null)
        Debug.Log("Calling function name is " + callingFunction);
    else
        Debug.Log("Calling function not supplied.");
    }


Aucun commentaire:

Enregistrer un commentaire