Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Where to download from and install .NET Framework 4.0?

I tried to re target the application to .net 4.8 but then keep getting the error when compiling.

I have a project in c# winforms not my project and it’s old and when I try to compile it I’m getting this error.

Severity Code Description Project File Line Suppression State
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 TestApp

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I browsed to the site: https://dotnet.microsoft.com/en-us/download/visual-studio-sdks?cid=msbuild-developerpacks

but when I’m looking the .net 4.0 there is no download link.

.net 4 developer pack but no download link

>Solution :

You have this error:

The reference assemblies for .NETFramework,Version=v4.0 were not found.

(emphasis mine)

Now I do see a link for the 4.0 reference assemblies in that screen shot, but it takes you to a page with no download. However, the very first sentence in the page is this:

When you target a particular version of .NET Framework, by default your application is built by using the reference assemblies that are included with that version’s developer pack.

What’s going on here is all versions of .Net Framework 4.0 and later share the same basic runtime, and so you’ll always see the "4.0" in that error message regardless of what specific 4.0-series version you’re actually using. However, because of minor updates or changes to implementation details, the reference assemblies with each version may be slightly different.

Therefore, if you’re targeting (say) .Net 4.8.1, you also need the developer pack for 4.8.1, which will include the correct 4.0 runtime reference assemblies you want.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading