Collapse the table of content
Expand the table of content

add Element for assemblies for compilation (ASP.NET Settings Schema) 

Adds an assembly reference to the collection.

             [,Version=version number] 

The following sections describe attributes, child elements, and parent elements.


Attribute Description


Required String attribute.

Specifies a comma-separated assembly combination consisting of version, culture, and public key tokens. ASP.NET searches for the assembly DLL first in the private Bin directory for the application, and then in the system assembly cache.

Child Elements


Parent Elements

Element Description


The root element in every configuration file that is used by the common language runtime and the .NET Framework applications.


Specifies the root element for the ASP.NET configuration section.


Configures all compilation settings that ASP.NET uses to compile applications.


Defines a collection of names of assemblies that are used during compilation of an ASP.NET application.

The add element adds an assembly reference to use during compilation of a dynamic resource. ASP.NET automatically links this assembly to the resource when compiling each code module.

The value of the add element is an assembly name, not a DLL path. ASP.NET looks up the assembly name to find its physical DLL location. Optionally, you can specify the asterisk (*) wildcard character to add every assembly within the private assembly cache for the application, which is located either in the \bin subdirectory of an application or in the.NET Framework installation directory (%systemroot%\Microsoft.NET\Framework\version\). For detailed information, see Load.

The following default assemblies element is configured in the root Web.config file.

    <add assembly="mscorlib" />
    <add assembly="System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add assembly="System.Configuration, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <add assembly="System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <add assembly="System.Data, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add assembly="System.Web.Services, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <add assembly="System.Xml, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <add assembly="System.Drawing, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <add assembly="System.EnterpriseServices, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <add assembly="System.Web.Mobile, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <add assembly="*" />

The following code example demonstrates how to add an assembly reference to an application.

            <add assembly="System.Data, Version=1.0.2411.0, 

Configuration section handler


Configuration member


Configurable locations


Root-level Web.config

Application-level Web.config

Virtual or physical directory–level Web.config


Microsoft Internet Information Services (IIS) version 5.0, 5.1, or 6.0

The .NET Framework version 1.0, 1.1, or 2.0

Microsoft Visual Studio 2003 or Visual Studio 2005

Community Additions

© 2015 Microsoft