Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here
The AL task wraps AL.exe, a tool that is distributed with the Windows Software Development Kit (SDK). This Assembly Linker tool is used to create an assembly with a manifest from one or more files that are either modules or resource files. Compilers and development environments might already provide these capabilities, so it is often not necessary to use this task directly. The Assembly Linker is most useful to developers needing to create a single assembly from multiple component files, such as those that might be produced from mixed-language development. This task does not combine the modules into a single assembly file; the individual modules must still be distributed and available in order for the resulting assembly to load correctly. For more information on AL.exe, see Al.exe (Assembly Linker).
Parameters
The following table describes the parameters of the AL task.
| Parameter | Description | 
|---|---|
| AlgorithmID | Optional Stringparameter.Specifies an algorithm to hash all files in a multifile assembly except the file that contains the assembly manifest. For more information, see the documentation for the /algidoption in Al.exe (Assembly Linker). | 
| BaseAddress | Optional Stringparameter.Specifies the address at which a DLL will be loaded on the user’s computer at run time. Applications load faster if you specify the base address of the DLLs, rather than letting the operating system relocate the DLLs in the process space. This parameter corresponds to the /base[address] option in Al.exe (Assembly Linker). | 
| CompanyName | Optional Stringparameter.Specifies a string for the Companyfield in the assembly. For more information, see the documentation for the/comp[any]option in Al.exe (Assembly Linker). | 
| Configuration | Optional Stringparameter.Specifies a string for the Configurationfield in the assembly. For more information, see the documentation for the/config[uration]option in Al.exe (Assembly Linker). | 
| Copyright | Optional Stringparameter.Specifies a string for the Copyrightfield in the assembly. For more information, see the documentation for the/copy[right]option in Al.exe (Assembly Linker). | 
| Culture | Optional Stringparameter.Specifies the culture string to associate with the assembly. For more information, see the documentation for the /c[ulture]option in Al.exe (Assembly Linker). | 
| DelaySign | Optional Booleanparameter.trueto place only the public key in the assembly;falseto fully sign the assembly. For more information, see the documentation for the/delay[sign]option in Al.exe (Assembly Linker). | 
| Description | Optional Stringparameter.Specifies a string for the Descriptionfield in the assembly. For more information, see the documentation for the/descr[iption]option in Al.exe (Assembly Linker). | 
| EmbedResources | Optional ITaskItem []parameter.Embeds the specified resources in the image that contains the assembly manifest. This task copies the contents of the resource file into the image. The items passed in to this parameter may have optional metadata attached to them called LogicalNameandAccess. TheLogicalNamemetadata is used to specify the internal identifier for the resource.  TheAccessmetadata can be set toprivatein order to make the resource not visible to other assemblies. For more information, see the documentation for the/embed[resource]option in Al.exe (Assembly Linker). | 
| EvidenceFile | Optional Stringparameter.Embeds the specified file in the assembly with the resource name of Security.Evidence.You cannot use Security.Evidencefor regular resources. This parameter corresponds to the/e[vidence]option in Al.exe (Assembly Linker). | 
| ExitCode | Optional Int32output read-only parameter.Specifies the exit code provided by the executed command. | 
| FileVersion | Optional Stringparameter.Specifies a string for the File Versionfield in the assembly. For more information, see the documentation for the/fileversionoption in Al.exe (Assembly Linker). | 
| Flags | Optional Stringparameter.Specifies a value for the Flagsfield in the assembly. For more information, see the documentation for the/flagsoption in Al.exe (Assembly Linker). | 
| GenerateFullPaths | Optional Booleanparameter.Causes the task to use the absolute path for any files that are reported in an error message. This parameter corresponds to the /fullpathsoption in Al.exe (Assembly Linker). | 
| KeyContainer | Optional Stringparameter.Specifies a container that holds a key pair. This will sign the assembly (give it a strong name) by inserting a public key into the assembly manifest. The task will then sign the final assembly with the private key. For more information, see the documentation for the /keyn[ame]option in Al.exe (Assembly Linker). | 
| KeyFile | Optional Stringparameter.Specifies a file that contains a key pair or just a public key to sign an assembly. The compiler inserts the public key in the assembly manifest and then signs the final assembly with the private key. For more information, see the documentation for the /keyf[ile]option in Al.exe (Assembly Linker). | 
| LinkResources | Optional ITaskItem []parameter.Links the specified resource files to an assembly. The resource becomes part of the assembly, but the file is not copied. The items passed in to this parameter may have optional metadata attached to them called LogicalName,Target, andAccess. TheLogicalNamemetadata is used to specify the internal identifier for the resource. TheTargetmetadata can specify the path and filename to which the task copies the file, after which it compiles this new file into the assembly. TheAccessmetadata can be set toprivatein order to make the resource not visible to other assemblies. For more information, see the documentation for the/link[resource]option in Al.exe (Assembly Linker). | 
| MainEntryPoint | Optional Stringparameter.Specifies the fully qualified name (class.method) of the method to use as an entry point when converting a module to an executable file. This parameter corresponds to the /mainoption in Al.exe (Assembly Linker). | 
| OutputAssembly | Required ITaskItem output parameter. Specifies the name of the file generated by this task. This parameter corresponds to the /outoption in Al.exe (Assembly Linker). | 
| Platform | Optional Stringparameter.Limits which platform this code can run on; must be one of x86,Itanium,x64, oranycpu. The default isanycpu. This parameter corresponds to the/platformoption in Al.exe (Assembly Linker). | 
| ProductName | Optional Stringparameter.Specifies a string for the Productfield in the assembly. For more information, see the documentation for the/prod[uct]option in Al.exe (Assembly Linker). | 
| ProductVersion | Optional Stringparameter.Specifies a string for the ProductVersionfield in the assembly. For more information, see the documentation for the/productv[ersion]option in Al.exe (Assembly Linker). | 
| ResponseFiles | Optional String[]parameter.Specifies the response files that contain additional options to pass through to the Assembly Linker. | 
| SdkToolsPath | Optional Stringparameter.Specifies the path to the SDK tools, such as resgen.exe. | 
| SourceModules | Optional ITaskItem []parameter.One or more modules to be compiled into an assembly. The modules will be listed in the manifest of the resulting assembly, and will still need to distributed and available in order for the assembly to load. The items passed into this parameter may have additional metadata called Target, which specifies the path and filename to which the task copies the file, after which it compiles this new file into the assembly. For more information, see the documentation for Al.exe (Assembly Linker). This parameter corresponds to the list of modules passed into Al.exe without a specific switch. | 
| TargetType | Optional Stringparameter.Specifies the file format of the output file: library(code library),exe(console application), orwin(Windows-based application). The default islibrary. This parameter corresponds to the/t[arget]option in Al.exe (Assembly Linker). | 
| TemplateFile | Optional Stringparameter.Specifies the assembly from which to inherit all assembly metadata, except the culture field. The specified assembly must have a strong name. An assembly that you create with the TemplateFileparameter will be a satellite assembly. This parameter corresponds to the/templateoption in Al.exe (Assembly Linker). | 
| Timeout | Optional Int32parameter.Specifies the amount of time, in milliseconds, after which the task executable is terminated. The default value is Int.MaxValue, indicating that there is no time out period. | 
| Title | Optional Stringparameter.Specifies a string for the Titlefield in the assembly. For more information, see the documentation for the/titleoption in Al.exe (Assembly Linker). | 
| ToolPath | Optional Stringparameter.Specifies the location from where the task will load the underlying executable file (Al.exe). If this parameter is not specified, the task uses the SDK installation path corresponding to the version of the framework that is running MSBuild. | 
| Trademark | Optional Stringparameter.Specifies a string for the Trademarkfield in the assembly. For more information, see the documentation for the/trade[mark]option in Al.exe (Assembly Linker). | 
| Version | Optional Stringparameter.Specifies the version information for this assembly. The format of the string is major.minor.build.revision. The default value is 0. For more information, see the documentation for the /v[ersion]option in Al.exe (Assembly Linker). | 
| Win32Icon | Optional Stringparameter.Inserts an .ico file in the assembly. The .ico file gives the output file the desired appearance in File Explorer. This parameter corresponds to the /win32iconoption in Al.exe (Assembly Linker). | 
| Win32Resource | Optional Stringparameter.Inserts a Win32 resource (.res file) in the output file. For more information, see the documentation for the /win32resoption in Al.exe (Assembly Linker). | 
Remarks
In addition to the parameters listed above, this task inherits parameters from the ToolTaskExtension class, which itself inherits from the ToolTask class. For a list of these additional parameters and their descriptions, see ToolTaskExtension Base Class.
Example
The following example creates an assembly with the specified options.
<AL  
    EmbedResources="@(EmbeddedResource)"  
    Culture="%(EmbeddedResource.Culture)"  
    TemplateFile="@(IntermediateAssembly)"  
    KeyContainer="$(KeyContainerName)"  
    KeyFile="$(KeyOriginatorFile)"  
    DelaySign="$(DelaySign)"  
  
    OutputAssembly=  
       "%(EmbeddedResource.Culture)\$(TargetName).resources.dll">  
  
    <Output TaskParameter="OutputAssembly"  
        ItemName="SatelliteAssemblies"/>  
</AL>