对于引用第三方组件的最佳实践 [英] Best practices for referencing 3rd party assemblies

查看:324
本文介绍了对于引用第三方组件的最佳实践的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直想知道什么是最好的做法,当谈到引用第三方组件。前段时间我问了一个问题<一href="http://stackoverflow.com/questions/268214/dependencies-and-references-what-exactly-should-i-reference">Dependencies和参考文献:究竟应该我引用,并获得一些思考,但我并不完全相信。我需要建立我的项目,并根据我读到目前为止,我只引用需要建立我的项目组件第三方组件。这使得第三方组件的运行时依赖的问题。如果我引用引用那些过于列表变成巨大的(因为有几个依赖关系),并包括了很多组件我不知道该怎么做,真的是不相关的我的项目。此外,我想避免使用公共的方法在任何这些,只是使用的主要的第三方组件。我怎么能去一个体面的方式这样做呢? 任何帮助AP preciated,我感到很困惑。

I have been wondering what are best practices when it comes to referencing 3rd party assemblies. A while ago I asked a question "Dependencies and references: what exactly should I reference" and received something to think about but I am not completely convinced. I have a 3rd party assembly needed for building my project and according to what I have read so far I should only reference assemblies needed for building my project. This leaves the problem of the runtime dependencies of the 3rd party assembly. If I reference those too the list of references becomes huge (as there are several dependencies) and includes a lot of assemblies I have no clue what do and are really not related to my project. Also I want to avoid using public methods in any of those and just use the main 3rd party assembly. How can I go about doing this in a decent way? Any help is appreciated as I am quite confused.

要放弃什么,我处理这里的第三方库使用Hibernate和log4net的以及办公互操作程序集的想法。

To give an idea of what I am dealing with here is the 3rd party library uses hibernate and log4net along with office interop assemblies.

感谢。

推荐答案

如果我必须处理未在海关总署注册的图书馆,我用下面的方法:

If i have to deal with libraries that aren't registered in the GAC, I use the following method:

  • 请一个文件夹利布斯与所有第三方库和它们的依赖于它
  • 引用的那些,我需要
  • 创建一个生成后的行动,副本即libs文件夹中的所有文件的bin /调试(或释放)文件夹

如果您不知道的依赖关系,您可以使用的Dependency Walker

If you don't know the dependencies, you can use Dependency Walker.

这篇关于对于引用第三方组件的最佳实践的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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