AssemblyBuilder.AddAssemblyReference Method
Assembly: System.Web (in system.web.dll)
A BuildProvider implementation uses the AddAssemblyReference method when generating source code that references types within the input assembly.
The ASP.NET build environment initializes the default collection of assemblies available for reference through the build provider in the BuildProvider.ReferencedAssemblies property. If the build provider generates source code that references additional assemblies, the build provider adds the additional assemblies using the AddAssemblyReference method. The ASP.NET build environment resolves external types during assembly compilation using both the referenced assemblies added by build providers and the default collection of assemblies available for reference.
Typically, a BuildProvider object adds source code to the AssemblyBuilder object in the GenerateCode method. If a build provider generates source code that uses an external type, the build provider adds the type's assembly using the AssemblyBuilder.AddAssemblyReference method.
Use the AddAssemblyReference method to add a referenced assembly required in source code generated by a BuildProvider instance for a specific file type. Use the assemblies Element for compilation (ASP.NET Settings Schema) configuration element to configure an assembly for reference across multiple file types in a project.
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.