Solved

VB6 to VB.NET Need version info

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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 …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

630 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