I want to get a namespace string from a strongly typed namespace reference in a similar way as C# 6 nameof() works for types and type members.
namespace This.Is.My.Namespace
{
class Program
{
static void Main()
{
string namespaceString = nameof(This.Is.My.Namespace);
Console.Write(namespaceString);
}
}
}
But the result i get is only the last portion of the namespace (e.g. "Namespace"). I'm targeting .NET 4.6
Is this possible?
REMARK: I want to be able to reference any available namespace, not only the containing one.