Help a newbie out. I cannot seem to explicitly convert an Object to a
Reflection.Asse mblyCompanyAttr ibute type using DirectCast(). Turning Option
Strict "Off" is not an option.
Here is the Error:
Option Strict On disallows implicit conversions from 'System.Object' to
'System.Reflect ion.AssemblyCom panyAttribute'.
Here is the code:
Public ReadOnly Property Company() As String Implements
IAssemblyInfo.C ompany
Get
Dim attrCompany As SR.AssemblyComp anyAttribute
'*** The following line produces the conversion error ***
attrCompany =
Me._assemblyInf o.GetCustomAttr ibutes(GetType( SR.AssemblyComp anyAttribute),
False)(0)
Return attrCompany.Com pany.ToString
End Get
End Property
Any help is greatly appreciated.
carl
Reflection.Asse mblyCompanyAttr ibute type using DirectCast(). Turning Option
Strict "Off" is not an option.
Here is the Error:
Option Strict On disallows implicit conversions from 'System.Object' to
'System.Reflect ion.AssemblyCom panyAttribute'.
Here is the code:
Public ReadOnly Property Company() As String Implements
IAssemblyInfo.C ompany
Get
Dim attrCompany As SR.AssemblyComp anyAttribute
'*** The following line produces the conversion error ***
attrCompany =
Me._assemblyInf o.GetCustomAttr ibutes(GetType( SR.AssemblyComp anyAttribute),
False)(0)
Return attrCompany.Com pany.ToString
End Get
End Property
Any help is greatly appreciated.
carl
Comment