Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does VS let you select previous .NET framework?

How does Visual Studio let you select a previous .NET framework version when the latest version is an in-place replacement of the earlier version. For example, say I install .NET 4.6 which is an in-place replacement for .NET 4, 4.5, 4.5.1 and 4.5.2, what exactly happens when I choose version 4 to use?

like image 897
Sandy Avatar asked Nov 18 '15 22:11

Sandy


People also ask

Can I remove old versions of Microsoft .NET Framework?

1 Answer. You cannot remove all versions of . NET as Windows (and many apps) rely on it.


1 Answers

In C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework there are "Reference Assemblies" which have the same public API as the old versions but do not have any implementation.

While you are coding IntelliSense is using those reference versions to show you what is available and what is a compiler error. However when the code is actually compiled the "installed" version is the one that is actually used and compiled against. The reason they can do this is because they keep 100% backward compatibility for the versions they do in place upgrades for so anything written against the 4 API will compile without errors in the 4.6 API.

like image 167
Scott Chamberlain Avatar answered Oct 21 '22 12:10

Scott Chamberlain