Programmatically getting the GUID of an application Intrigued by the events chronicled here (also here and here), I saw the inherent utility in having a program-specific GUID available. The SO answers that were correct seemed a bit tightly-coupled and verbose. So I set out to make my own for use. Looking for a critique on the idea itself as well as maintainability, performance, etc. Improvements welcome.

public static class AssemblyExtensions
{
    /// &lt;summary&gt;
    /// The &lt;see cref="GuidAttribute"/&gt; for the entry assembly lazily gotten as a &lt;see cref="Guid"/&gt; if it exists,
    /// &lt;see cref="Guid.Empty"/&gt; otherwise.
    /// &lt;/summary&gt;
    private static readonly Lazy&lt;Guid&gt; _MyGuid = new Lazy&lt;Guid&gt;(() =&gt; Assembly.GetEntryAssembly().GetGuid());

    /// &lt;summary&gt;
    /// Lazily gets the &lt;see cref="GuidAttribute"/&gt; for the entry assembly as a &lt;see cref="Guid"/&gt; if it exists,
    /// &lt;see cref="Guid.Empty"/&gt; otherwise.
    /// &lt;/summary&gt;
    /// &lt;returns&gt;The &lt;see cref="GuidAttribute"/&gt; for the entry assembly as a &lt;see cref="Guid"/&gt; if it exists,
    /// &lt;see cref="Guid.Empty"/&gt; otherwise.&lt;/returns&gt;
    public static Guid GetMyGuid() =&gt; _MyGuid.Value;

    /// &lt;summary&gt;
    /// Gets the &lt;see cref="GuidAttribute"/&gt; for the given assembly as a &lt;see cref="Guid"/&gt; if it exists,
    /// &lt;see cref="Guid.Empty"/&gt; otherwise.
    /// &lt;/summary&gt;
    /// &lt;param name="assembly"&gt;The assembly.&lt;/param&gt;
    /// &lt;returns&gt;The &lt;see cref="GuidAttribute"/&gt; for the given assembly as a &lt;see cref="Guid"/&gt; if it exists,
    /// &lt;see cref="Guid.Empty"/&gt; otherwise.&lt;/returns&gt;
    public static Guid GetGuid(this Assembly assembly) =&gt; Guid.TryParse(
        ((GuidAttribute)assembly?.GetCustomAttributes(typeof(GuidAttribute), false).SingleOrDefault())?.Value,
        out Guid guid) ? guid : Guid.Empty;
}
Well, there isn't much to say here. But I still see some stuff I don't really like.  

The implementations of Lazy&lt;Guid&gt; _MyGuid and Guid GetMyGuid() are quite simple and easy to read and understand. What bothers me here is that for the variable, and both methods the documentation is almost the same. But, at least for me, more critical is the documentation of Guid GetMyGuid() which states "Lazily gets ..." which is clearly an implementation detail which I wouldn't show.  

The method Guid GetGuid() is another thing. IMO its very hard to read and understand by sprawling the Guid.TryParse() over 3 lines.   

The change I will suggest is a little bit longer but its more readable, at least for me  

public static Guid GetGuid(this Assembly assembly)
{
    var guidAttribute = (GuidAttribute)assembly?.GetCustomAttributes(typeof(GuidAttribute), false).SingleOrDefault();
    if(Guid.TryParse(guidAttribute?.Value, out Guid guid)) { return guid; }
    return Guid.Empty;
}  


which could also be written like so  

public static Guid GetGuid(this Assembly assembly)
{
    var guidAttribute = (GuidAttribute)assembly?.GetCustomAttributes(typeof(GuidAttribute), false).SingleOrDefault();
    Guid.TryParse(guidAttribute?.Value, out Guid guid); // If Guid.TryParse returns false the out Guid is Guid.Empty
    return guid;
}