Page 115 - CSharp/C#
P. 115

Chapter 12: AssemblyInfo.cs Examples




        Remarks



        The filename AssemblyInfo.cs is used by convention as the source file where developers place
        metadata attributes that describe the entire assembly they are building.


        Examples



        [AssemblyTitle]


        This attribute is used to give a name to this particular assembly.


         [assembly: AssemblyTitle("MyProduct")]


        [AssemblyProduct]


        This attribute is used to describe the product that this particular assembly is for. Multiple
        assemblies can be components of the same product, in which case they can all share the same
        value for this attribute.


         [assembly: AssemblyProduct("MyProduct")]


        Global and local AssemblyInfo


        Having a global allows for better DRYness, you need only put values that are different into
        AssemblyInfo.cs for projects that have variance. This use assumes your product has more than
        one visual studio project.


        GlobalAssemblyInfo.cs


         using System.Reflection;
         using System.Runtime.InteropServices;
         //using Stackoverflow domain as a made up example

         // It is common, and mostly good, to use one GlobalAssemblyInfo.cs that is added
         // as a link to many projects of the same product, details below
         // Change these attribute values in local assembly info to modify the information.
         [assembly: AssemblyProduct("Stackoverflow Q&A")]
         [assembly: AssemblyCompany("Stackoverflow")]
         [assembly: AssemblyCopyright("Copyright © Stackoverflow 2016")]

         // The following GUID is for the ID of the typelib if this project is exposed to COM
         [assembly: Guid("4e4f2d33-aaab-48ea-a63d-1f0a8e3c935f")]
         [assembly: ComVisible(false)] //not going to expose ;)

         // Version information for an assembly consists of the following four values:
         // roughly translated from I reckon it is for SO, note that they most likely



        https://riptutorial.com/                                                                               61
   110   111   112   113   114   115   116   117   118   119   120