Reputation: 99
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?
Upvotes: 5
Views: 5358
Reputation: 45
Faced the same error and the solution was just to download and install .NET Framework 4.8.1 from here: https://dotnet.microsoft.com/en-us/download/dotnet-framework/net40
Then restart pc and the problem was solved.
Upvotes: 0
Reputation: 175
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.
Upvotes: 11