Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I still compile code requiring .net 4.0 developer pack?

I am trying to compile an old program, I downloaded the source code, It was a bunch of .cs files. When I opened it up in VSStudio and tried to compile it, I got this error:

The reference assemblies for .NETFramework,Version=v4.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks

After doing some research, some have had success compiling this on an older version of visual studio. I am going to try that now,

But does anyone know if I can still even compile this code anymore?

Compiling in VisualStudio 2022 with .NET 4.8

like image 371
TechNoob Avatar asked Oct 20 '25 04:10

TechNoob


1 Answers

You can see from this page:

Starting with Visual Studio 2022, Visual Studio no longer includes .NET Framework components for .NET Framework 4.0 - 4.5.1 because these versions are no longer supported. Visual Studio 2022 and later versions can't build apps that target .NET Framework 4.0 through .NET Framework 4.5.1. To continue building these apps, you can use Visual Studio 2019 or an earlier version.

You can refer to this page to migrate earlier versions of .NET Framework to .NET Framework 4.8. https://learn.microsoft.com/en-us/dotnet/framework/migration-guide/

like image 96
Jingmiao Xu-MSFT Avatar answered Oct 21 '25 17:10

Jingmiao Xu-MSFT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!