AssemblyInfo

S

Scott Perez

I am trying to reproduce the about box found in the 101
vb.net samples and when I retrieve the assemblyInfo It
shows the assembly name as System.Windows.Forms.dll For
the life of me I can't figure out where this is coming
from. I have tried recreating the AssemblyInfo file as
well as the aboutform. Thanks in advance for the help. I
am using VS 2003.

Here is a copy of my AssemblyInfo.vb file

Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices

' General Information about an assembly is controlled
through the following
' set of attributes. Change these attribute values to
modify the information
' associated with an assembly.

' Review the values of the assembly attributes

<Assembly: AssemblyTitle("EH")>
<Assembly: AssemblyDescription("EH")>
<Assembly: AssemblyCompany("Booz Allen & Hamilton")>
<Assembly: AssemblyProduct("EH")>
<Assembly: AssemblyCopyright("Copyright © 2003
Booz|Allen|Hamilton")>
<Assembly: AssemblyTrademark("")>
<Assembly: CLSCompliant(True)>

'The following GUID is for the ID of the typelib if this
project is exposed to COM
<Assembly: Guid("F8296C53-8F32-4598-955D-B45E43553228")>

' Version information for an assembly consists of the
following four values:
'
' Major Version
' Minor Version
' Build Number
' Revision
'
' You can specify all the values or you can default the
Build and Revision Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("1.0.0.0")>

#Region " Helper Class to Get Information for the About
form. "
' This class uses the System.Reflection.Assembly class to
' access assembly meta-data
' This class is not a normal feature of AssemblyInfo.vb
Public Class AssemblyInfo
' Used by Helper Functions to access information from
Assembly Attributes
Private myType As Type

Public Sub New()
myType = GetType(MainMenu)
End Sub

Public ReadOnly Property AsmName() As String
Get
Return myType.Assembly.GetName.Name.ToString()
End Get
End Property
Public ReadOnly Property AsmFQName() As String
Get
Return
myType.Assembly.GetName.FullName.ToString()
End Get
End Property
Public ReadOnly Property CodeBase() As String
Get
Return myType.Assembly.CodeBase
End Get
End Property
Public ReadOnly Property Copyright() As String
Get
Dim at As Type = GetType
(AssemblyCopyrightAttribute)
Dim r() As Object =
myType.Assembly.GetCustomAttributes(at, False)
Dim ct As AssemblyCopyrightAttribute = CType(r
(0), AssemblyCopyrightAttribute)
Return ct.Copyright
End Get
End Property
Public ReadOnly Property Company() As String
Get
Dim at As Type = GetType
(AssemblyCompanyAttribute)
Dim r() As Object =
myType.Assembly.GetCustomAttributes(at, False)
Dim ct As AssemblyCompanyAttribute = CType(r
(0), AssemblyCompanyAttribute)
Return ct.Company
End Get
End Property
Public ReadOnly Property Description() As String
Get
Dim at As Type = GetType
(AssemblyDescriptionAttribute)
Dim r() As Object =
myType.Assembly.GetCustomAttributes(at, False)
Dim da As AssemblyDescriptionAttribute = CType
(r(0), AssemblyDescriptionAttribute)
Return da.Description
End Get
End Property
Public ReadOnly Property Product() As String
Get
Dim at As Type = GetType
(AssemblyProductAttribute)
Dim r() As Object =
myType.Assembly.GetCustomAttributes(at, False)
Dim pt As AssemblyProductAttribute = CType(r
(0), AssemblyProductAttribute)
Return pt.Product
End Get
End Property
Public ReadOnly Property Title() As String
Get
Dim at As Type = GetType
(AssemblyTitleAttribute)
Dim r() As Object =
myType.Assembly.GetCustomAttributes(at, False)
Dim ta As AssemblyTitleAttribute = CType(r(0),
AssemblyTitleAttribute)
Return ta.Title
End Get
End Property
Public ReadOnly Property Version() As String
Get
Return myType.Assembly.GetName.Version.ToString
()
End Get
End Property
End Class

#End Region
 
M

Mattias Sjögren

Scott,
I am trying to reproduce the about box found in the 101
vb.net samples and when I retrieve the assemblyInfo It
shows the assembly name as System.Windows.Forms.dll For
the life of me I can't figure out where this is coming
from.

In the constructor you get the Type of MainMenu, which is implemented
in the System.Windows.Forms assembly. That's why. If you replace
MainMenu with some class in your own assembly, it should work as
expected.



Mattias
 
S

Scott Perez

Thanks alot I figured it was something stupid
-----Original Message-----
Scott,


In the constructor you get the Type of MainMenu, which is implemented
in the System.Windows.Forms assembly. That's why. If you replace
MainMenu with some class in your own assembly, it should work as
expected.



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top