Issue with converting a C# project from v4.2 to 8.0

I've got a C# project that I started 4 or 5 months ago. I started it on Visual Studio 2022 and the project uses C# and Windows Forms. I worked on it a little bit and left it. Now I've come back to it. I wanted to continue coding, but I stumbled upon the problem where I see this error: feature default interface implementation is not available in c# 7.3 I found I've been using an older 4.2 version of .NET. I changed the target framework in my .csproj file by adding net8.0 and also latest, as well as removing the older TargetFramework. Then I had a problem with "duplicate compile items", so I added false and false. Now, I no longer get that problem, but sadly I have other issues I can't resolve: Firstly, I have these two messages: The file does not support code parsing or generation because it is not contained within a project that supports this code I also have almost 200 errors that all look like this: The type or namespace does not exist in the namespace (are you missing an assembly reference) (I've seen this link, but my framework is indeed 8.0). The type name could not be found in the namespace. This type has been forwarded to assembly... Consider adding a reference to that assembly. All the problems seem to be related to Forms, since all the errors I've clicked so far point me to a line like this: private System.Windows.Forms.DataGridViewTextBoxColumn totalSpacesDataGridViewTextBoxColumn; I assume it has something to do with the 2 messages that are telling me I have a problem with 2 of the forms. I also tried to add references, but that didn't work. Does anyone know how to fix this? Realistically, it's not that much of a problem to start the project again, but I don't want to do the forms all over again, since it took some time.

Issue with converting a C# project from v4.2 to 8.0

I've got a C# project that I started 4 or 5 months ago. I started it on Visual Studio 2022 and the project uses C# and Windows Forms.

I worked on it a little bit and left it. Now I've come back to it. I wanted to continue coding, but I stumbled upon the problem where I see this error:

feature default interface implementation is not available in c# 7.3

I found I've been using an older 4.2 version of .NET. I changed the target framework in my .csproj file by adding net8.0 and also latest, as well as removing the older TargetFramework.

Then I had a problem with "duplicate compile items", so I added false<\EnableDefaultCompileItems> and false<\EnableDefaultEmbeddetResourceItems>. Now, I no longer get that problem, but sadly I have other issues I can't resolve:

Firstly, I have these two messages:

The file does not support code parsing or generation because it is not contained within a project that supports this code

I also have almost 200 errors that all look like this:

The type or namespace does not exist in the namespace (are you missing an assembly reference)

(I've seen this link, but my framework is indeed 8.0).

The type name could not be found in the namespace. This type has been forwarded to assembly... Consider adding a reference to that assembly.

All the problems seem to be related to Forms, since all the errors I've clicked so far point me to a line like this:

private System.Windows.Forms.DataGridViewTextBoxColumn totalSpacesDataGridViewTextBoxColumn;

I assume it has something to do with the 2 messages that are telling me I have a problem with 2 of the forms. I also tried to add references, but that didn't work.

Does anyone know how to fix this?

Realistically, it's not that much of a problem to start the project again, but I don't want to do the forms all over again, since it took some time.