Solved

VB6 to VB.NET Need version info

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

752 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