Upgrading project from VS 2003 to VS 2017

1k Views Asked by At

I have been tasked with upgrading a VB project from VS 2003 to Vs 2017. After attempting the standard Visual Studio upgrade and receiving many issues, I set about researching. It turned out that the best way to do this, per my research, was to create a new project in VS 2017 and then copy all files from the old project into the new then work through the errors.

I did this and added the necessary references, changed necessary pathways and to my chagrin, received 11,118 errors. The largest sum of errors are:

  1. At 7235 errors Code: BC31429 - 'object' is ambiguous because multiple kinds of members with this name exist in class 'class'.

  2. At 2217 errors Code: BC30269 - 'function()' has multiple definitions with identical signatures.

These errors, to me, indicate a duplication of sorts. I haven't been able to find anything on the subject myself, however. I'm still a bit green to this profession so I may be missing something obvious.

My questions are: Have I missed something obvious? Have I FUBAR'd this project? How should I go about resolving this?

Thanks

Edit: Some examples for these errors

Code: BC31429

Return Me.tableNotes

Returns the error despite having only one reference in its class. There is, however, another instance of the same name and type in another class. Both are private so I figured that they shouldn't interfere with one another.

Code: BC30269

Public Sub New()
        MyBase.New
        Me.InitClass
        Dim schemaChangedHandler As System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged
        AddHandler Me.Tables.CollectionChanged, schemaChangedHandler
        AddHandler Me.Relations.CollectionChanged, schemaChangedHandler
    End Sub

    Protected Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
        MyBase.New
        Dim strSchema As String = CType(info.GetValue("XmlSchema", GetType(System.String)),String)
        If (Not (strSchema) Is Nothing) Then
            Dim ds As DataSet = New DataSet
            ds.ReadXmlSchema(New XmlTextReader(New System.IO.StringReader(strSchema)))
            If (Not (ds.Tables("Notes")) Is Nothing) Then
                Me.Tables.Add(New NotesDataTable(ds.Tables("Notes")))
            End If
            Me.DataSetName = ds.DataSetName
            Me.Prefix = ds.Prefix
            Me.Namespace = ds.Namespace
            Me.Locale = ds.Locale
            Me.CaseSensitive = ds.CaseSensitive
            Me.EnforceConstraints = ds.EnforceConstraints
            Me.Merge(ds, false, System.Data.MissingSchemaAction.Add)
            Me.InitVars
        Else
            Me.InitClass
        End If
        Me.GetSerializationData(info, context)
        Dim schemaChangedHandler As System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged
        AddHandler Me.Tables.CollectionChanged, schemaChangedHandler
        AddHandler Me.Relations.CollectionChanged, schemaChangedHandler
    End Sub

    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class NotesDataTable
        Friend Sub New()
            MyBase.New("Notes")
            Me.InitClass
        End Sub

        Friend Sub New(ByVal table As DataTable)
            MyBase.New(table.TableName)
            If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then
                Me.CaseSensitive = table.CaseSensitive
            End If
            If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then
                Me.Locale = table.Locale
            End If
            If (table.Namespace <> table.DataSet.Namespace) Then
                Me.Namespace = table.Namespace
            End If
            Me.Prefix = table.Prefix
            Me.MinimumCapacity = table.MinimumCapacity
            Me.DisplayExpression = table.DisplayExpression
        End Sub
    End Class
1

There are 1 best solutions below

4
JimMSDN On

You're attempting a large jump all at once across many technology changes, both explicit and subtle. Perhaps it would be better to break the upgrade up into steps by trying to first upgrade from the VS 2003 era to, say, the VS 2010 era by installing an older version of VS from here. This might reduce the number errors you initially face and allow you to tackle those first (and, perhaps, prevent multiple generations of errors from interacting with one another) before then moving onto a subsequent upgrade (or upgrades) towards VS 2017.