To complement my previous post bemoaning the lack of respect for AssemblyInfo , I wanted to illustrate just how easy it is to add a few custom attributes to our AssemblyInfo file:
This is a companion discussion topic for the original blog entry at: http://www.codinghorror.com/blog/2004/11/custom-assemblyinfo-attributes.html
Yeah, you could also just strip the “System.Reflection.Assembly” from the beginning and “Attribute” from the end of the assembly type name. This way you wouldn’t need to add a case clause for every new costum attribute you add. It would result in cleaner code, but in a little less efficient method.
Tyron
December 16, 2005, 12:00am
3
Yay, thanks for that. I wanted to have a ReleaseType Attribute
If anyone needs that in C#, here you go:
[AttributeUsage(AttributeTargets.Assembly)]
public class AssemblyReleaseTypeAttribute : System.Attribute
{
private string _strReleaseType;
public AssemblyReleaseTypeAttribute(string ReleaseType)
{
_strReleaseType = ReleaseType;
}
public virtual string ReleaseType {
get {
return _strReleaseType;
}
}
}
Mike
January 17, 2006, 12:00am
4
Thanks. This was just what I was looking for.
Dan
April 25, 2006, 12:00am
5
How do you call the GetAssemblyAttribs function? I can’t find a valid value for the parameter.
System.Reflection.Assembly.GetCallingAssembly
System.Reflection.Assembly.GetEntryAssembly
Csabi
December 17, 2007, 12:00am
8
How can I make the custom attribute appear in the Version tab, when I look at the dll’s properties in Windows Explorer?
Csabi,
in C# i have created 2 classess and i am able to compile them sucessfully, but the problem is I can not see them in properties tab.
Can anyone help?
TIA