Solved

VB6 to VB.NET Need version info

Posted on 2007-04-10
4
188 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
Comment Utility
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
Comment Utility
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
Comment Utility
Figured it out.  Needed to drop the new in the dim clause
0
 
LVL 67

Expert Comment

by:sirbounty
Comment Utility
Ah - glad you got it sorted.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
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…
This video discusses moving either the default database or any database to a new volume.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 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

10 Experts available now in Live!

Get 1:1 Help Now