none
Why can't I run the source code from VS2013 project in VS2017?

    Question

  • Why can't I run the source code written in a previous version of Visual Studio - VS2013 and have it work in VS2017?

    The project file from VS2013 contains everything necessary for the project, but will not function in the newest version on Visual Studio.

    Why?



    MRM256

    Wednesday, February 6, 2019 6:21 PM

All replies

  • I have plenty of VS2013 projects and VS2012 project open without any issues in VS2017 were some are plain vanilla project and others with third party libraries.

    So what exactly happens e.g. build errors, forms not opening etc?


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Wednesday, February 6, 2019 6:43 PM
    Moderator
  • As Karen states, my experience was exactly the same, from 2010 to 2013 to 2015 to 2017. Details please.
    Wednesday, February 6, 2019 11:00 PM
  • Hi Devon,

    I spent $500.00 for Visual Studio Professional 2013.

    Next, I spent a few weeks developing a database tool that dynamically creates data entry forms based on the schema of the database table. I could use this tool for both Microsoft Access and SQL Server database systems.

    Recently, I downloaded and installed the free version of Visual Studio 2017.

    Before I make any modifications to an existing project. I open it up in the upgraded version of Visual Studio to see if it still works as designed.

    The project loads and runs without showing any errors, but the part of the application that looks for SQL Servers on the network stopped functioning. This is puzzling, because it should.

    When I look at the project in the IDE certain resources are missing from the project.

     Why? All the namespaces, resources, and source code are stored in the project file. They should be included when the project is opened.

    I should mention this test is performed with a standard installation of the new developer's suite.

    I have never had this problem until the introduction of the Framework. From my experience with the framework. Every time there is a change the existing application has to be rewritten. This is mostly due to  what processes or features Microsoft decided to downgrade or eliminate entirely.

    Not a good idea if you want developers to continue using your product.

    I know exactly where the problem is occurring in my project.

    dt = Sql.SqlDataSourceEnumerator.Instance.GetDataSources()

    This is included in the System.Data.Sql and/or System.Data.SqlClient namespaces.

    The only explanation that I can come up to explain this is Microsoft either dropped or stomped on something in these Namespaces causing the failure.

    As I pointed out to Karen: The rule of upgrades is they should contain all the modifications of previous versions to insure backward compatibility.

    Thanks,


    MRM256

    Thursday, February 7, 2019 3:18 PM
  • Hi Karen,

    Sorry for the delayed reply.

    There are no build errors when executed through the IDE. It just doesn't show my instance of SQL Server on my other PC connected into my network.

    I don't understand why it works in VS2013 and stops in VS2017. 

    if it works in the older version, but doesn't in the new one. Obviously there is something different between the two. 

    IMHO - a developer should not have to spend his time chasing down why his previously working application stopped working when he upgraded his development suite.

    Thanks, 


    MRM256

    Friday, February 8, 2019 4:36 PM
  • Hi Karen,

    Sorry for the delayed reply.

    There are no build errors when executed through the IDE. It just doesn't show my instance of SQL Server on my other PC connected into my network.

    I don't understand why it works in VS2013 and stops in VS2017. 

    if it works in the older version, but doesn't in the new one. Obviously there is something different between the two. 

    IMHO - a developer should not have to spend his time chasing down why his previously working application stopped working when he upgraded his development suite.

    Thanks, 


    MRM256

    I agree with your last statement but can't reproduce what has happened to you. I've taken older code from home and executed it on the current version of the Framework and VS on a higher OS and zero issues.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, February 8, 2019 5:11 PM
    Moderator
  • Hi Karen,

    Did you try the "Simple Simon Test"? 

    What I mean is: Install the new version of VS onto your PC. Open the .sln or .vbproj using the new IDE and run it.

    This is what I did and it failed.

    Am I correct in assuming that the .sln or .vbproj files should contain references to the required namespaces and resources?

    Thanks,


    MRM256

    Friday, February 8, 2019 5:20 PM
  • Hi Karen,

    Did you try the "Simple Simon Test"? 

    What I mean is: Install the new version of VS onto your PC. Open the .sln or .vbproj using the new IDE and run it.

    This is what I did and it failed.

    Am I correct in assuming that the .sln or .vbproj files should contain references to the required namespaces and resources?

    Thanks,


    MRM256

    I've gone way beyond the "Simple Simon Test" with zero problems, same with simple projects too. 

    VS2013 project and solution files "are" different than VS2015/VS2017. VS2015 to VS2017 and back again are compatible.

    When I take a VS2013 solution to VS2017, I copy it from the VS2013 folder to the VS2017\VS2013 folder so if there were issues I have a backup and if someone wants a older version not touched by newer versions of VS I have them still.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, February 8, 2019 7:53 PM
    Moderator
  • Hi Karen,

    Just for giggles I would like to see if this code snippet works for you.

    The needed Namespaces are:

    Imports System.Data.Sql
    Imports System.Data.SqlClient

    The code that worked in VS2013 to return instances of SQL Server:

     Public Function lst_SQLServers() As List(Of String)
            'Purpose:       List all instances of MS-SQL Servies on the
            '               the Network
            'Parameters:    None
            'Returns:       A List of SQL Server instances.
            'declare variables
            Dim dt As Data.DataTable = Nothing
            Dim dr As Data.DataRow = Nothing
            Dim listSQL As List(Of String) = New List(Of String)
    
            Try
                'get sql server instances in to DataTable object
                dt = Sql.SqlDataSourceEnumerator.Instance.GetDataSources()
                For I = 0 To dt.Rows.Count - 1 'Step I + 1
                    listSQL.Add(dt.Rows(I)(0).ToString)
                    'Debug.Print(dt.Rows(I)(0).ToString)
                Next
    
            Catch ex As System.Data.SqlClient.SqlException
                'Log error 
                Dim el As New Log.ErrorLogger
                el.WriteToErrorLog(ex.Message, _
                                   ex.StackTrace, _
                                   "Error - lst_SQLServers")
    
            Catch ex As Exception
                'Log error 
                Dim el As New Log.ErrorLogger
                el.WriteToErrorLog(ex.Message, _
                                   ex.StackTrace, _
                                   "Error - lst_SQLServers")
            Finally
                'clean up ;)
                dr = Nothing
                dt = Nothing
            End Try
            Return listSQL
        End Function

    I am curious to know if it works for you.


    MRM256

    Monday, February 11, 2019 7:44 PM