I have recently been asked to do some work on a rather old Umbraco 7.2 project which targets .NET Framework 4.5.
My day-to-day editor of choice is Visual Studio 2022, as such when I tried to open the project I was greeted with the error message:
The Web project PROJECTNAME targets .NET Framework 4.5, which is no longer supported. While you can change your target framework at any time, for stability and security we recommend that you move to a recent supported release.
The fix that worked for me was to download the assemblies from NuGet and then copy them over to the local Reference Assemblies folder on my machine, I have outlined the steps for you below:
- Download Microsoft.NETFramework.ReferenceAssemblies.net45 from NuGet
- Unzip microsoft.netframework.referenceassemblies.net45.1.0.3.nupkg
- Copy the files from
build\.NETFramework\v4.5
folder toProgram Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5
- Restart Visual Studio
Alternatively, you can download the Windows 8 SDK and when installing only select the .NET Framework 4.5 option.
If none of the above work for you, then you can install Visual Studio 2019 and use that to work with your project.
About the author
Aaron Sadler
Aaron Sadler, Umbraco MVP (2x), Umbraco Certified Master Developer and DevOps Engineer