This documentation is archived and is not being maintained.

@ Assembly Directive in XML Web Services

Links an assembly to an XML Web service during compilation, making all the assembly's classes and interfaces available for use by the XML Web service.

<%@ Assembly Name="assemblyname" %>
<%@ Assembly Src="pathname" %>


The name of the assembly to link to the XML Web service.
Note   The assembly name does not include a file name extension.
The path to a source file to dynamically compile and link against.
Note   You cannot include a Name and a Src attribute in the same @ Assembly directive. If you want to use both, you must include more than one directive on the page.


The compiler references the assembly at compile time, allowing early binding. Once compilation of the XML Web service is complete, the assembly is dyamically loaded into the application domain when it changes, allowing late binding.

Assemblies that reside in your Web application's \bin directory are automatically linked to XML Web services in that application. Such assemblies do not require the @ Assembly directive.

Note   The path to the assembly or source file in an @ Assembly directive must be a relative path to the Web application hosting the XML Web service.


The following code fragment uses two @ Assembly directives, the first to link to MyAssembly, a user-defined assembly, the second to MySource.vb, a Visual Basic source file located in the src folder beneath the directory of the Web application hosting the XML Web service.

<%@ Assembly Name="MyAssembly" %>
<%@ Assembly Src="src/MySource.vb" %>

See Also

XML Web Services Syntax | Building XML Web Services Using ASP.NET