Solved

VB6 to VB.NET Need version info

Posted on 2007-04-10
4
189 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now