Updating the Target to .NET Framework 4.8 causes errors

Cynolycus 255 Reputation points
2023-07-26T08:42:55.8466667+00:00

I had to reload my laptop and roll back a driver due to insane amounts of BSODs.

So far it is working fine but I had to re-install Visual Studio and now when I go to load my project it wants me to Update the Target to .NET Framework 4.8 and won't let me load the project if I don't.

The problem is that if I do the Update the project is then full of errors, nearly every line.

For instance, at the top of one form's code it has "Inherits System.Windows.Forms.Form" but Visual Studio has flagged it as an error BC30002 Type 'System.Windows.Forms.Form' is not defined. How can a form not be defined?

It says this for Buttons, Panels, Checkboxes etc. It seems that every object that has been placed on any of the forms is not defined.

This project had Option Strict turned on with no errors at all the last time I ran it in the installation of Visual Studio that was used to create it. I had several attempts of reloading this laptop to get rid of the BSODs. On one attempt during this last week, I reloaded Visual Studio and successfully loaded and ran this project with no errors without having to Update it to .NET Framework 4.8, in fact I thought I had created it using 4.8, but I could be wrong, so why all the errors now?

I am also given the option to download the .NET Framework 4.8 targeting pack when I try to load the project, but I don't know what it is for or if I need it for my project to work.

This project was all but finished, it only needed some more statistics to be added to a table by code.

I know very little about Visual Studio or .NET, this is my 2nd project in .NET and also my 2nd project since VB6.

Is there a way to get this project working again?

Any help would be appreciated.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,415 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,498 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Cynolycus 255 Reputation points
    2023-07-26T09:08:21.03+00:00

    Problem Solved.

    For some reason this last time the laptop was reloaded .NET 4.8 wasn't.

    I just installed .NET 4.8 and everything is fine.

    It is strange thou because I didn't load it with the other attempts to fix this laptop and yet the project worked.

    1 person found this answer helpful.