Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2022 does not find reference assemblies for >NETframework Version 4.0

Trying to compile Python Django project but receiving build error:

C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(1217,5): error MSB3644: 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 Done building project "myFinancialTracker.pyproj" -- FAILED.

How can I resolve?

like image 763
Guy M Avatar asked Sep 04 '26 18:09

Guy M


1 Answers

I also got the same error as you. This happened because Visual Studio 2022 doesn't offer the .NET Framework 4.0 option during installation. To solve this issue, I installed Visual Studio 2019 and enabled the use of .NET Framework 4.0 during its installation. After completing the installation, I tried to run my project again using Visual Studio 2022, and the error finally disappeared.

I tried to download and install .NET Framework 4.0 separately, but Microsoft did not allow me to do so. As a workaround, I chose to install Visual Studio 2019 instead.

like image 114
Doerlap Avatar answered Sep 06 '26 15:09

Doerlap



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!