Saw some code snippet inside AssemblyInfo.cs like
[assembly: someattributename]
What does this code mean?
I even saw some method to be used inside assembly, like
[assembly: log4net.Config.XmlConfigurator(Watch=true)]
Is this the attribute anymore?
It means this an attribute on the assembly itself and not on a specific class, method, property etc.
AssemblyInfo. cs contains information about your assembly, like name, description, version, etc.
Assembly identity attributes Three attributes (with a strong name, if applicable) determine the identity of an assembly: name, version, and culture. These attributes form the full name of the assembly and are required when you reference it in code. You can set an assembly's version and culture using attributes.
Attributes are always applied to an element (e.g. a method, property). The "assembly:" prefix means that the attribute (the part you omitted using '*') is applied to the assembly.
Applying Attributes at the Assembly Level If you want to apply an attribute at the assembly level, use the Assembly keyword. The following code shows the AssemblyNameAttribute applied at the assembly level.
using System.Reflection; [assembly:AssemblyTitle("My Assembly")]
When this attribute is applied, the string "MyAssembly" is placed in the assembly manifest in the metadata portion of the file. You can view the attribute either by using the MSIL Disassembler (Ildasm.exe) or by creating a custom program to retrieve the attribute.
It means this an attribute on the assembly itself and not on a specific class, method, property etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With