locked
Upgrading vb2008 to vb2019. All forms abort RRS feed

  • Question

  • I have been working on an OLD program in VB2008, and upgrading the code. I know there are problems upgrading to a higher compiler and having the forms not upgrade. I have 25-30 forms. The program now runs, but there is a LOT of untested code. Upgrading to 2019 would make sure everything runs on 2019 once I get the code upgraded. The error I get on the forms when I upgrade is: Could not resolve mscorlib for target framework '.NETFramework,Version=v4.0'. This can happen if the target framework is not installed or if the framework moniker is incorrectly formatted.

    Net 4.0 IS there or VB2008 wouldn't run. How can I correct this error? Would changing the .Net version in Properties help? I have tried to get mscorlib but there are many of them & I don't know which I need. I need detailed information, please.

    Wednesday, November 11, 2020 12:19 AM

Answers

  • I built as shown below, took out two references the ADO one (would not build with it) and the power tools.

    Ran the project but failed on a data read operation, don't have time to investigate.

    Note I did upgrade the Framework and lastly removed the project from my machine.


    Please remember to mark the replies as answers if they help and unmarked 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.

    NuGet BaseConnectionLibrary for database connections.

    My GitHub code samples
    GitHub page

    • Marked as answer by Douglas Harter Thursday, November 12, 2020 8:14 PM
    Thursday, November 12, 2020 6:19 PM

All replies

  • Under project properties see if Framework 4 or above is installed (and if so and is an earlier version get a newer version), if not install it as per below.

    Or fo one of the projects not building delete the obj folder, do a rebuild, does that change anyting?


    Please remember to mark the replies as answers if they help and unmarked 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.

    NuGet BaseConnectionLibrary for database connections.

    My GitHub code samples
    GitHub page

    Wednesday, November 11, 2020 12:33 AM
  • It was listed as .Net Framework 4.0, so I changed it to 4.5.2, unloaded & reloaded the project as it specified and the same error shows up, except as 4.5.2. It also picked up an error saying the .vbproj was already loaded and it couldn't open it in an editor.

    I give up. If I can't get rid of the mscorlib error when I upgrade compilers, I have to rebuild all those Design screens and that is just not a good option. I will have to stay with 2008, even if it is not supported.

    If you want to see if YOU can upgrade it to a later compiler, I can send you the source files, zipped. I have 2012 & 2019.

    Wednesday, November 11, 2020 5:25 PM
  • It was listed as .Net Framework 4.0, so I changed it to 4.5.2, unloaded & reloaded the project as it specified and the same error shows up, except as 4.5.2. It also picked up an error saying the .vbproj was already loaded and it couldn't open it in an editor.

    I give up. If I can't get rid of the mscorlib error when I upgrade compilers, I have to rebuild all those Design screens and that is just not a good option. I will have to stay with 2008, even if it is not supported.

    If you want to see if YOU can upgrade it to a later compiler, I can send you the source files, zipped. I have 2012 & 2019.

    Hello,

    if you like I can take a look at the VS2019 solution (not simply the project).

    If a .zip file, upload to Microsoft OneDrive (it's free if you never used it before and easy to use) and provide a link.

    Here is a random example on my OneDrive.

    Even better is to use GitHub, also free but more entailed if never used before. The benefit of a GitHub repository is version control done right inside of Visual Studio.


    Please remember to mark the replies as answers if they help and unmarked 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.

    NuGet BaseConnectionLibrary for database connections.

    My GitHub code samples
    GitHub page

    Wednesday, November 11, 2020 6:46 PM
  • I have the solution zipped and on my OneDrive. Under Share the only option it seems to give me is an email address and I don't have yours.
    Wednesday, November 11, 2020 7:36 PM
  • I have the solution zipped and on my OneDrive. Under Share the only option it seems to give me is an email address and I don't have yours.

    You can create folders, place .zip files in them, not sure about a "Shared" folder but you can create a folder and then mark it as shared.

    And you can mark a file as shared

    Then


    Please remember to mark the replies as answers if they help and unmarked 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.

    NuGet BaseConnectionLibrary for database connections.

    My GitHub code samples
    GitHub page

    Wednesday, November 11, 2020 8:46 PM
  • https://1drv.ms/u/s!Atm8vFLwkxqljaF8U5brw-DNPF8f7w?e=EkKjMm

    I guess that's what you need. Doesn't it make that available to anyone reading this thread?

    Wednesday, November 11, 2020 9:34 PM
  • Well I was able to load your projects but unfortunately I don't have your environment so can't move on to the Framework 4 issue.

    I'm on a Windows 10 64bit box that does not have COM items and have never used PowerPack.


    Please remember to mark the replies as answers if they help and unmarked 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.

    NuGet BaseConnectionLibrary for database connections.

    My GitHub code samples
    GitHub page

    Wednesday, November 11, 2020 10:19 PM
  • Too bad, I was hoping I could get this compiler upgrade problem resolved. I have 6 other programs in 2008. I will see if any do NOT have adodb & if I still have problems with the Design form, I will zip it, add it/them to the OneDrive directory & share it. I will then update this thread, whether I have any or not.
    Wednesday, November 11, 2020 11:52 PM
  • After checking all my other programs, I found only one which didn't use adodb and needed converted to run on 2019. That one upgraded the Design form with no problem. This included 10 which I had upgraded to 2012. It looks like I could move most of my old programs to 2019 with no problems. However, the ones using adodb also have more complicated Design forms than the others. Apparently some of the controls going between compiler versions don;t upgrade well,  but I can't prove it to your satisfaction since you don't have the same configuration as I do.

    Thanks a lot for your help. I was able to narrow the problem down a little.

    • Edited by Douglas Harter Thursday, November 12, 2020 1:17 AM Added thanks
    Thursday, November 12, 2020 1:13 AM
  • Hi Douglas Harter,

    >>It looks like I could move most of my old programs to 2019 with no problems. However, the ones using adodb also have more complicated Design forms than the others.

    If only forms using adodb cannot upgrade to vb2019, you can consider redesigning these forms in 2019.

    besides, you can also share your project here if you have any problems in this process.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 12, 2020 2:56 AM
  • Attn: Karen Payne

    https://1drv.ms/u/s!Atm8vFLwkxqljaIaMs0I463D-dnKQw?e=0Tljio

    I took another 2008 program which had 2 Design forms with a lot of info. I removed the references which caused you problems yesterday. I brought it as a solution into 2019 and let it upgrade. Both forms show the error I had trouble with.  Maybe you can do something with this one

    Thursday, November 12, 2020 4:05 PM
  • I built as shown below, took out two references the ADO one (would not build with it) and the power tools.

    Ran the project but failed on a data read operation, don't have time to investigate.

    Note I did upgrade the Framework and lastly removed the project from my machine.


    Please remember to mark the replies as answers if they help and unmarked 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.

    NuGet BaseConnectionLibrary for database connections.

    My GitHub code samples
    GitHub page

    • Marked as answer by Douglas Harter Thursday, November 12, 2020 8:14 PM
    Thursday, November 12, 2020 6:19 PM
  • Thanks again. I appreciate all the time you took on my problem. No one on any place I have submit it has gotten me a solution before.

    I never thought of taking references out of the Solution tree. I commented a couple things out so it would compile. I will make changes so it again will run and test it. If I have any further problems, I will resubmit under a different title.

    Thursday, November 12, 2020 8:24 PM
  • Happy to assist :-)

    Please remember to mark the replies as answers if they help and unmarked 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.

    NuGet BaseConnectionLibrary for database connections.

    My GitHub code samples
    GitHub page

    Thursday, November 12, 2020 9:02 PM