PC Review


Reply
Thread Tools Rate Thread

AssemblyInfo

 
 
Scott Perez
Guest
Posts: n/a
 
      28th Sep 2003
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
 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      28th Sep 2003
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

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
 
Reply With Quote
 
Scott Perez
Guest
Posts: n/a
 
      29th Sep 2003
Thanks alot I figured it was something stupid
>-----Original Message-----
>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
>
>--
>Mattias Sjögren [MVP] mattias @ mvps.org
>http://www.msjogren.net/dotnet/
>Please reply only to the newsgroup.
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AssemblyInfo.cs =?Utf-8?B?TXJOb2JvZHk=?= Microsoft C# .NET 2 4th Jan 2005 05:29 PM
AssemblyInfo Van Tumour Microsoft VC .NET 0 28th Sep 2004 07:37 PM
AssemblyInfo.cpp mphanke Microsoft VC .NET 1 28th Jul 2004 11:55 AM
How to use AssemblyInfo.cpp Howard Weiss Microsoft VC .NET 0 19th Jul 2004 06:23 PM
AssemblyInfo.cs =?Utf-8?B?c2FjaGlu?= Microsoft C# .NET 2 21st May 2004 07:49 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:15 PM.