.net 4.6 framework is inplace upgrade then how is the .net framework 4.5 works in vs2015?

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-07 06:50:14

问题


.net 4.6 framework is inplace upgrade then how is the .net framework 4.5 works in vs2015? I see only one folder v4.0.30319 . How is the dll stored and where ?


回答1:


Update: Note that Reference Assemblies only contain metadata and NOT any code at all. Thanks @vcsjones for pointing this out below!

You can find a "Reference Assemblies" folder on your system in which the exact binaries for each framework version are kept:

Reference Assemblies folder screenshot

Visual Studio then uses those depending on which version you are targeting. This is the System.dll reference from a project targeting .Net 4.5.1:

VS assembly reference screenshot




回答2:


.NET Framework 4.5 was an in-place upgrade for 4.0. 4.5.1 was an in-place for 4.5. 4.5.2 was an in-place for 4.5.1. 4.6 is also in place.

So it goes to reason that the 4.6 framework installs the v4.0.xxxxx directory.

Now, Visual Studio 2015 supports .NET Framework 4.5 for targeting. When you create a project that targets the 4.5 Framework, it limits you to using features that are only available in that version of the framework. If you have .NET Framework 4.6 installed (and you will with Visual Studio 2015), and target 4.5, the code will still be execute using the 4.6 Framework.



来源:https://stackoverflow.com/questions/32699520/net-4-6-framework-is-inplace-upgrade-then-how-is-the-net-framework-4-5-works-i

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!