WPF: Getting at information entered in Assembly Information dialog
anything you enter inside Assemblyinformation dialog sits in the AssemblyInfo.csYou can access these values using Assembly.GetExecutingAssembly.GetCustomAttributes(true/false);If you print the types of attributes returned, you can see something like shown below.System.Windows.ThemeInfoAttributeSystem.Diagnostics.DebuggableAttributeSystem.Runtime.CompilerServices.CompilationRelaxationsAttributeSystem.Runtime.InteropServices.ComVisibleAttributeSystem.Reflection.AssemblyFileVersionAttributeSystem.Runtime.CompilerServices.RuntimeCompatibilityAttributeSystem.Reflection.AssemblyTitleAttributeSystem.Reflection.AssemblyDescriptionAttributeSystem.Reflection.AssemblyConfigurationAttributeSystem.Reflection.AssemblyCompanyAttributeSystem.Reflection.AssemblyProductAttributeSystem.Reflection.AssemblyCopyrightAttributeSystem.Reflection.AssemblyTrademarkAttributeSo if you want to access the Description entered in the Assembly, you can do something like this.foreach (object o in Assembly.GetExecutingAssembly().GetCustomAttributes(true)){if (o is AssemblyDescriptionAttribute) Debug.WriteLine((o as AssemblyDescriptionAttribute).Description);}That is just an example.Hope this helps.
Worked great for me!
No comments:
Post a Comment