Share via


@ Assembly Directive in XML Web Services

This topic is specific to a legacy technology. XML Web services and XML Web service clients should now be created using Windows Communication Foundation.

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" %>

Attributes

Term

Definition

Name

The name of the assembly to link to the XML Web service.

a7c375wt.note(en-us,VS.100).gifNote:
The assembly name does not include a file name extension.

Src

The path to a source file to dynamically compile and link against.

a7c375wt.note(en-us,VS.100).gifNote:
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.

Remarks

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.

Example

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

Tasks

Walkthrough: Building a Basic XML Web Service Using ASP.NET