什么是未使用的程序集引用的成本? [英] What's the costs of unused assembly references?

查看:88
本文介绍了什么是未使用的程序集引用的成本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道什么引用组件的.NET解决方案的各种费用。我感兴趣的技术和组织成本。

I was wondering what the various costs of referencing assemblies in a .NET solution are. I'm interested in both technical and organizational costs.

一些例子:

  • 在未使用的组件包括额外的字节船(长下载,浪费的空间)
  • 在未使用的大会可能包含可利用的安全漏洞
  • 在未使用的大会可能产生额外的启动成本
  • 在未使用的大会可能产生额外的审查费用(这样的问题)
  • 在未使用的大会可能会混淆一个新的开发

推荐答案

如果您引用的程序集的项目,但实际上并不在该装配使用任何类型的未使用的组件将不会被最终产品的一部分。参考在编译时被删除。

If you reference an assembly in a project but actually don't use any types in that assembly the unused assembly will not be part of your final product. The reference is removed at compile time.

引用未使用的组件的唯一的开销是发展,其中引用许多未使用的组件可能会混淆什么依赖该项目的开发过程中。在你的项目中的每个新的组件也将创造一些开销智能感知和编译器,但在大多数情况下,你不会另行通知。

The only "overhead" of referencing unused assemblies is during development where referencing many unused assemblies may confuse the developer about what dependencies the project has. Each new assembly in your project will also create some overhead for IntelliSense and the compiler but in most cases you wont notice.

ReSharper的具有这样的功能,以分析是否引用程序集未使用。

ReSharper has a function to analyze if a referenced assembly is unused.

这篇关于什么是未使用的程序集引用的成本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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