Web.config中的组件 [英] Assemblies in Web.config

查看:174
本文介绍了Web.config中的组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经做.NET开发了大约一年,但我仍然不知道是什么目的的<装配方式> 部分

什么是部分的目的是什么?我可以删除有指定的组件?我问过一些资深开发商在我的球队,但他们只是告诉我忽略它。有人可以给我一个很好的解释就可以了?


解决方案

  

什么是组件部分​​的目的是什么?


<&集会GT; 在ASP.NET应用程序元素定义的过程中使用的组件编译的申请;该清单上的组件应该是你依赖,并因此需要为您code编译的。

这部分是必要的,因为ASP.NET将编译应用程序的用户第一次从你的应用程序请求的资源。在此编译过程中,ASP.NET需要你的依赖,以编译应用程序链接。默认情况下,ASP.NET将扫描文件夹和.NET Framework安装目录下找到指定的组件。


  

能的参考文献中在Web.config删除?


这取决于;如果你不使用的依赖,当然,你可以将其删除。最有可能的,你就可以删除其中的一部分,但不是全部。

要找出哪些依赖你可以删除,请执行以下操作:


  1. 从您的项目中删除引用。

  2. 编译应用程序。

  3. 如果您的应用程序仍然编译,继续前进,从你的web.config中删除;如果没有,请不要删除它。

希望这给你足够的信息来获得正确的方向前进。

I've been doing .NET development for about a year, but I still don't know what the purpose of the <assemblies> section is.

What is the section's purpose? Can I delete the assemblies specified in there? I asked some senior developers in my team but they just told me to ignore it. Can someone give me a good explanation on it?

解决方案

What is the purpose of the assemblies section?

The <assemblies> element in an ASP.NET application defines the assemblies that are used during compilation of an application; the assemblies on this list should be the ones you depend on and are thus required for your code to compile.

This section is necessary because ASP.NET will compile the application the first time a user requests a resource from your application. During this compilation process, ASP.NET needs to link in your dependencies in order to compile your application. By default, ASP.NET will scan the bin folder and the .NET framework installation directory to find the assemblies specified.

Can the references be deleted in the Web.config?

It depends; if you're not using the dependency, sure, you can delete it. Most likely, you'll be able to remove some of them, but not all of them.

To find out which dependencies you can remove, do the following:

  1. Remove the reference from your project.
  2. Compile your application.
  3. If your application still compiles, go ahead and remove it from your Web.config; if it doesn't, don't remove it.

Hope this gives you enough info to get moving in the right direction.

这篇关于Web.config中的组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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