Solved

VB6 to VB.NET Need version info

Posted on 2007-04-10
4
191 Views
Last Modified: 2008-02-01
Converting from VB6 to VB.NET and new at it so any help would be great.  I have posted the code below from the .NET and the two errors.  I am trying to get the Name, copy and version info but not much luck.  Please Help.

Code
Public Sub TRACE(ByVal pstrLogData As String)
        Dim strAppVer, strLogData1 As String
        Dim App As New ApplicationId
        Const LOGLOC = "\Program Files\Rite Aid\Vru\Logs\HolidayHours.Log"

        Try
            strAppVer = App.Name & "." & App.Copy & App.Version
            'Add the string to the list with the time.
            strLogData1 = "-" & pstrLogData
            usrctlLogger.LogToFile(LOGLOC, strAppVer, strLogData1)

        Catch ex As Exception
            End
        End Try
    End Sub

Error Mssg 1
Argument not specified for parameter 'version' of 'Public Sub New(publicKeyToken() As Byte, name As String, version As System.Version, processorArchitecture As String, culture As String)'.

Error Mssg 2
Operator '&' is not defined for types 'String' and 'System.ApplicationId'.
0
Comment
Question by:triplebd69
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 67

Accepted Solution

by:
sirbounty earned 250 total points
ID: 18884842
There's a couple of different ways of getting at it - depending on what you're after...

strAppVer=my.Application.Info.Version.ToString
strAppVer=my.Application.Deployment.CurrentVersion.ToString
strAppVer=System.Diagnostics.FileVersionInfo.GetVersionInfo(system.Reflection.Assembly.GetEntryAssembly.Location).FileVersion

strAppName=my.Application.Info.AssemblyName
0
 

Author Comment

by:triplebd69
ID: 18885148
I really need to know what the error mssg is telling me and how to fix it.

Error Mssg 1
Argument not specified for parameter 'version' of 'Public Sub New(publicKeyToken() As Byte, name As String, version As System.Version, processorArchitecture As String, culture As String)'.

I get five error like the one above just replace 'version' with
'culture'
'name'
'publickeytoken'
and 'processorarchiteture'
0
 

Author Comment

by:triplebd69
ID: 18885274
Figured it out.  Needed to drop the new in the dim clause
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18885374
Ah - glad you got it sorted.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question