Changing project target framework while changing VS versions

357mag

Well-known member
Joined
Mar 31, 2023
Messages
58
Programming Experience
3-5
So Visual Studio 2019 will not open my projects made with 2015. Saying the .net framework targeting pack is wrong. They suggest installing 4.6.1. So I download the web installer and that says it's already installed or even a later version is installed. It doesn't show up in Control Panel. I don't see a 4.6.1 in Control Panel. Then another option they say is to download the targeting pack for 4.5.2.

Can't do that either. The progress bar just stops. I had a technician from my ISP check my internet connection last week. He said everything looked fine.

What am I supposed to do.

Rewrite all my programs in 2019?
 
You can try performing surgery on the .CSPROJ files and change the targeted framework.

Or alternatively, you can actually install VS2022 and start brand new blank projects, and then in the blank projects, you start adding in the files from your old 2015 projects.
 
Okay I successfully download 4.6.1 and I installed it. But now I gotta learn how to do this targeting stuff.
 
You don't need a targeting computer. "Use the force, Luke." :)

Seriously though:
1684359081135.png


which can be found if you right click on your project (not solution) and select Properties:
1684359142588.png
 
Okay I think I got it all fixed. I right-clicked on the project and hit properties, and made sure that 4.6.1 was selected. Now my programs run. Unless Microsoft has other surprises for me.
 
I highly recommend retargeting for 4.8.2 or at least 4.8. that will give you the most flexibility for the next time you may need to do this again. 4.6.1 is out of support.
 
For future reference, the thread title should be a summary of the actual problem. The title of this thread is as useful as no title at all.
 
Well, it's crazy to carry on using 462 :)

World's moved on. You dont need to "rewrite" anything, and most likely you don't even need to make any changes at all. Upgrade to 2022, load yoir project and change the target framework to latest
 
The OP was not showing us the exact errors that he was getting trying to open his old projects. He claims that the projects wouldn't even load while the old framework was not installed.

Anyway, as noted above, change to the latest framework (within the same family) is highly recommended. 4.8.2 is in the same family as 4.x and 3.5.
 
For future reference, the thread title should be a summary of the actual problem. The title of this thread is as useful as no title at all.

I couldn't take it any longer either. I've changed the title of this thread to better reflect the topic
 
I looked into this targeting as you suggested for .NET Framework 4.8 and I downloaded the offline 4.8 installer and double-clicked on it but Microsoft said that "Installation will not occur because the .NET Framework 4.8 or later is already installed on this computer."

What do I do now?

.NET Framework 4.8 does not show up in Add - Remove programs.
 
Well when I look into Control Panel Turn Windows Features On or Off I do see a .NET Framework 4.8 Advanced Services. Not sure how that got there.

But when I right-click on a project in Visual Studio and select Properties and look at the available frameworks it says this:

.NET Framework 2.0
.NET Framework 3.0
.NET Framework 3.5
.NET Framework 4.6.1
.NET Framework 4.7.2

Install other frameworks

The .NET Framework 4.8 is not listed there. So it's on my computer but it doesn't show up there?

Kinda confused.
 
Run the VS installer and select the .NET Framework 4.8 SDK and targeting pack from the list of individual components. You ought to do the same for NetFx 4.8.1. You probably ought to review other workloads and components while you're there.
 
downloaded the offline 4.8 installer

Mmm; common source of confusion- .net framework 4.8 is the set of libraries and modules needed to *run* programs written in C# targeting .net 4.8, whereas the ".net 4.8 SDK" is the set of modules and libraries needed to *create* C# programs that target 4.8

Developers typically install an SDK, end users typically install a runtime
 
Back
Top Bottom