如何使用VS2005引用GAC程序集-这有多有趣. [英] How to reference GAC assemblies using VS2005- how funny is this.

查看:73
本文介绍了如何使用VS2005引用GAC程序集-这有多有趣.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚发现了如何使用VS2005从C#解决方案向GAC中的程序集添加引用.
I've just discovered how I add a reference to an assembly in the GAC from a C# solution using VS2005.

推荐答案

为什么您到底想从GAC复制程序集并将其移出GAC吗?在许多方面,您会不知不觉地导致更多的问题.

Why on earth would you want to copy assemblies from the GAC and move them outside of it? In many ways you are causing yourself more problems without knowing it.

在VS2005中,当您添加引用时,将从.NET选项卡中显示系统上的所有程序集...目录X:\ Windows \ Microsoft.NET \ Framework \ v2中的那些程序集.0.50727和其他类似的目录(其中X是您安装了框架的驱动器)位于GAC中.请记住,就实际文件位置而言,GAC只是一组文件夹,其逻辑在其他位置运行,以管理哪个文件,哪个版本.

In VS2005 when you add a reference, from within the .NET tab you are being shown all of the assemblies that are located on the system... those within the directory X:\Windows\Microsoft.NET\Framework\v2.0.50727 and other similar dirs (where X is the drive you have the framework installed to) are in the GAC. Remember, as far as the actual file locations are concerned, the GAC is just a set of folders with logic running elsewhere that manages which file is which and which version is which.

从GAC复制文件并在外部使用它们时...是的,您仍在引用它们...仅当稍后运行应用程序时,才会使用复制出来的程序集,而不会使用GAC中的程序集是因为运行时查找程序集的方式(http://msdn.microsoft.com/library/default.asp ?url =/library/zh-cn/cpguide/html/cpconhowruntimelocatesassemblies.asp ).

When you copy files from the GAC and use them externally... yes, you are still referencing them... only when you run your app later, the assemblies you copied out are not being used, instead those in the GAC are because of the way the runtime locates assemblies (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconhowruntimelocatesassemblies.asp).


这篇关于如何使用VS2005引用GAC程序集-这有多有趣.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆