GAC和sidebyside
GAC解决的问题是dotnet assembly如何共享assembly的问题,比如dotnet framework,肯定要部署到GAC中。注:dotnet assembly locate rule是先找GAC,再找当前app所在的目录树(CLR will firstly search in GAC for assembly loading and then get into app specific directory / path tree)。所以,对于公用的assembly,只有一条路:就是放在GAC中。
sidebyside assembly解决的是dotnet assembly 版本冲突的问题。两方面的工作借助OS作为媒介来实现:一方面,那些sidebyside assembly,比如donet framework assemblies,MFC,ATL,CRT dlls,需要一个manifest文件来描述它自己给OS; 另一方面,使用它们的app,需要一个manifest文件来告诉OS他要使用的是哪个版本的assembly。这个样子下来,OS就了了,就能在app跑起来的时候,知道app需要哪个版本的assembly并知道去哪里去找到啦。(DLL hell designates a group of problems that arise from the use of dynamic-link libraries in Microsoft Windows. Problems include version conflicts, missing DLLs, duplicate DLLs, and incorrect or missing registration. In SxS, Windows stores multiple versions of a DLL in the WinSXS subdirectory of the Windows directory, and loads them on demand. This reduces dependency problems for applications that include an SxS manifest.)
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步