Try the following code. The value you are looking for is stored on a GuidAttribute
instance attached to the Assembly
using System.Runtime.InteropServices;
static void Main(string[] args)
{
var assembly = typeof(Program).Assembly;
var attribute = (GuidAttribute)assembly.GetCustomAttributes(typeof(GuidAttribute),true)[0];
var id = attribute.Value;
Console.WriteLine(id);
}
Related Contents:
- String vs. StringBuilder
- What is the purpose of “return await” in C#?
- Good or bad practice for Dialogs in wpf with MVVM?
- Reading large text files with streams in C#
- Linq: GroupBy, Sum and Count
- Detect if running as Administrator with or without elevated privileges?
- Why is HttpClient BaseAddress not working?
- Should I use public properties and private fields or public fields for data?
- Equivalent to ‘app.config’ for a library (DLL)
- How can a Word document be created in C#? [closed]
- What is the simplest way to get indented XML with line breaks from XmlDocument?
- How do I access ARP-protocol information through .NET?
- Why does C# XmlDocument.LoadXml(string) fail when an XML header is included?
- Capture screenshot Including Semitransparent windows in .NET
- Generate and Sign Certificate Request using pure .net Framework
- Check if a value is in an array (C#)
- Static Indexers?
- Comparing strings with tolerance
- Why isn’t ArrayList marked [Obsolete]?
- What’s the correct alternative to static method inheritance?
- What is the “cost” of .NET reflection? [duplicate]
- Deserializing XML to Objects in C#
- What is the use for Task.FromResult in C#
- Does C# support a variable number of arguments, and how?
- How do I raise an event via reflection in .NET/C#?
- Why can’t you use the keyword ‘this’ in a static method in .Net?
- How can I embed an application manifest into an application using VS2008?
- Why enums require an explicit cast to int type?
- How to retrieve the LoaderException property?
- Performance of Find() vs. FirstOrDefault() [duplicate]
- DateTime ToString issue with formatting months with “mm” specifier
- C# ListView Column Width Auto
- the name does not exist in the namespace clr-namespace
- C#: How to create an attribute on a method triggering an event when it is invoked?
- Why does a bad password cause “Padding is invalid and cannot be removed”?
- How to get a dimension (slice) from a multidimensional array
- Lock-free multi-threading is for real threading experts
- Invalid URI: The format of the URI could not be determined
- How to throttle requests in a Web Api?
- Can .NET Task instances go out of scope during run?
- Backslash and quote in command-line arguments
- How to log all thrown exceptions?
- Include with FromSqlRaw and stored procedure in EF Core 3.1
- Why “decimal” is not a valid attribute parameter type?
- Truncate string on whole words in .NET C#
- Destructor vs IDisposable?
- Is there a much better way to create deep and shallow clones in C#?
- How to play a WPF Sound File resource
- copy files with authentication in c#
- How to do an “in” query in entity framework?