Pack — Net Framework 4.0 Targeting

dir "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\" If you see v4.0 , you are good. If not, reinstall the SDK. Modern NuGet (v6+) sometimes refuses to restore packages for net40 . You need to add this to your nuget.config :

However, pragmatism wins in enterprise software. If you have a 100,000-line WinForms app that uses WebClient (not HttpClient ) and third-party DLLs from a defunct vendor, net framework 4.0 targeting pack

Your manager says, "Just change the Target Framework dropdown to 4.0." You need to add this to your nuget

<add key="NuGetOfficial" value="https://api.nuget.org/v3/index.json" /> <add key="MicrosoftAndNet" value="https://www.myget.org/F/aspnetwebstacknightly/" /> Many packages have dropped net40 support. You may need to use legacy versions (e.g., Newtonsoft.Json 12.x, not 13.x). Let’s be honest: You should migrate off .NET 4.0. Extended support ended in 2016 . Security patches for the runtime itself ended long ago. Let’s be honest: You should migrate off

Scroll to Top