首页 文章

.Net Framework引用路径与已加载程序集路径[重复]

提问于
浏览
0

这个问题在这里已有答案:

我对.Net Framework的程序集感到有点困惑 .

当我查看从我的控制台应用程序引用的框架dll时,它显示.net框架路径(C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework.NETFramework \ v4.5.2)

enter image description here

当我查看调试中的模块窗口时,它显示了程序集加载的程序集和路径,它显示了GAC .

enter image description here

所以我的问题是,如果它从GAC加载程序集,为什么它显示来自.Net框架路径的引用路径,这条路径的作用是什么? (C:\ Program Files(x86)\ Reference Assemblies \ Microsoft \ Framework.NETFramework \ v4.5.2)

在csproj文件中,没有.Net Framework程序集的路径 . 当我想从框架中添加一个新程序集时,此程序集检索的路径显示在窗口下方?

enter image description here

enter image description here

对不起,如果我找不到正确的话来问我的问题 . 我希望,很明显:)

1 回答

  • 1

    引用程序集可供您引用和编译 . 它们仅包含签名,它们作为.NET Targeting Pack和SDK的一部分安装 .

    框架程序集是在运行时使用的,并具有实际的实现 . 它们是在运行时绑定的并具有向后兼容性,因为它们可能是构建时针对的框架的较新版本 .

    an excellent video that was posted recently by Immo Landwerth here . 我强烈建议观看它,因为它清楚地解释了一切 .

相关问题