I have a control which retrieves the Assembly Attributes and stores them.
When a user uses my control. Id like to have it display the assembly info for the program that person is running.
As of now it will only display the assembly info that i created when i designed the control.
Ive tried using the following code. When this code is finished executing... it returns "System.Windows.Forms.dll"
im looking for it to return the title of the program that owns this control.
Take note i am using the method System.Reflection.Assembly.GetCallingAssembly not GetExecutingAssembly.
GetExecutingAssembly returns my controls attributes instead.
is what im doing possible? it seems like there is a method somewhere to help me accomplish this
Id really appreciate an answer on this one. This bug is really hurting the flexibility of the utility im writing.
brandon
When a user uses my control. Id like to have it display the assembly info for the program that person is running.
As of now it will only display the assembly info that i created when i designed the control.
Ive tried using the following code. When this code is finished executing... it returns "System.Windows.Forms.dll"
im looking for it to return the title of the program that owns this control.
Take note i am using the method System.Reflection.Assembly.GetCallingAssembly not GetExecutingAssembly.
GetExecutingAssembly returns my controls attributes instead.
C#:
public void GetAttributes()
{
Assembly asmInfo;
AssemblyTitleAttribute atrTitle;
//set assembly variables
asmInfo = Assembly.Load(Assembly.GetCallingAssembly().GetName());
objAttributes = asmInfo.GetCustomAttributes(false);
//Convert from object to desired types
//Select Case needed because order of attributes in array varies
foreach(object objItem in objAttributes)
{
switch (objItem.GetType().ToString())
{
case "System.Reflection.AssemblyTitleAttribute":
{
atrTitle = (AssemblyTitleAttribute)objItem;
lblInfo.Text = atrTitle.Title.ToString();
break;
}
}
}
is what im doing possible? it seems like there is a method somewhere to help me accomplish this
Id really appreciate an answer on this one. This bug is really hurting the flexibility of the utility im writing.
brandon