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?
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.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:
Hope this gives you enough info to get moving in the right direction.
This has some good explornation.
It's worth noting that this sub-key of Web.Config can be used to reference common assemblies in your webform app, so you don't have to include a reference in every page or control that uses the assembly.
This is used quite commonly in ASP.Net MVC.
Phil Haack has an example of this: http://haacked.com/archive/2006/11/14/register_custom_controls_in_web.config.aspx