我可以为系统命名空间创建扩展方法并将其添加到 GAC 中吗?

发布于 2024-09-28 06:36:58 字数 141 浏览 1 评论 0原文

原则上,我可以创建一个类库来存储我的系统命名空间的扩展方法,并将其添加到 GAC 中,以便可以从我的开发计算机中的任何项目使用,并且能够部署在 GAC 上其他机器的设置项目?

如果有,你觉得有用吗?

提前致谢。

In principle, can I create a class library to store my Extension methods for System namespace for example, and add it to the GAC to be usable from any project in my development machine and able to deployment on the GAC of other machines by the setup project ?

If yes, Do you think it useful?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丶视觉 2024-10-05 06:36:58

是的,您可以创建一个扩展方法并将其放入 System 命名空间中定义的类中,然后在 GAC 中部署程序集。其他项目可以引用 GAC 的程序集并使用扩展方法。

你觉得有用吗?

就我个人而言,我讨厌 GAC,并且从不将其用于自定义程序集。我总是喜欢独立的应用程序,但对于使用它的人来说,这可能会很好。

Yes you can create an extension method and put it in a class defined in the System namespace and then deploy the assembly in the GAC. Other projects could reference the assembly from the GAC and use the extension method.

Do you think it useful?

Personally I hate the GAC and never use it for custom assemblies. I always prefer applications to be self contained but for people who use it, it could be nice.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文