ResolveComReference Task

 

For the latest documentation on Visual Studio 2017, see Visual Studio 2017 Documentation.

For the latest documentation on Visual Studio 2017, see ResolveComReference Task on docs.microsoft.com. Takes a list of one or more type library names or .tlb files and resolves those type libraries to locations on disk.

The following table describes the parameters of the ResolveCOMReference task.

ParameterDescription
DelaySignOptional Boolean parameter.

If true, places the public key in the assembly. If false, fully signs the assembly.
EnvironmentVariablesOptional String[] parameter.

Array of pairs of environment variables, separated by equal signs. These variables are passed to the spawned tlbimp.exe and aximp.exe in addition to, or selectively overriding, the regular environment block..
ExecuteAsToolOptional Boolean parameter.

If true, runs tlbimp.exe and aximp.exe from the appropriate target framework out-of-proc to generate the necessary wrapper assemblies. This parameter enables multi-targeting.
IncludeVersionInInteropNameOptional Boolean parameter.

If true, the typelib version will be included in the wrapper name. The default is false.
KeyContainerOptional String parameter.

Specifies a container that holds a public/private

key pair.
KeyFileOptional String parameter.

Specifies an item that contains a public/private

key pair.
NoClassMembersOptional Booleanparameter.
ResolvedAssemblyReferencesOptional ITaskItem[] output parameter.

Specifies the resolved assembly references.
ResolvedFilesOptional ITaskItem[] output parameter.

Specifies the fully qualified files on disk that correspond to the physical locations of the type libraries that were provided as input to this task.
ResolvedModulesOptional ITaskItem[]parameter.
SdkToolsPathOptional String parameter.

If ExecuteAsTool is true, this parameter must be set to the SDK tools path for the framework version being targeted.
StateFileOptional String parameter.

Specifies the cache file for COM component timestamps. If not present, every run will regenerate all the wrappers.
TargetFrameworkVersionOptional String parameter.

Specifies the project target framework version.

The default is String.Empty. which means there is no filtering for a reference based on the target framework.
TargetProcessorArchitectureOptional String parameter.

Specifies the preferred target processor architecture. Passed to the tlbimp.exe /machine flag after translation.

The parameter value should be a member of ProcessorArchitecture.
TypeLibFilesOptional ITaskItem[] parameter.

Specifies the type library file path to COM references. Items included in this parameter may contain item metadata. For more information, see the section "TypeLibFiles Item Metadata" below.
TypeLibNamesOptional ITaskItem[] parameter.

Specifies the type library names to resolve. Items included in this parameter must contain some item metadata. For more information, see the section "TypeLibNames Item Metadata" below.
WrapperOutputDirectoryOptional String parameter.

The location on disk where the generated interop assembly is placed. If this item metadata is not specified, the task uses the absolute path of the directory where the project file is located.

The following table describes the item metadata available for items passed to the TypeLibNames parameter.

MetadataDescription
GUIDRequired item metadata.

The GUID for the type library. If this item metadata is not specified , the task fails.
VersionMajorRequired item metadata.

The major version of the type library. If this item metadata is not specified , the task fails.
VersionMinorRequired item metadata.

The minor version of the type library. If this item metadata is not specified, the task fails.
LocaleIdentifierOptional item metadata.

The Locale Identifier (or LCID) for the type library. This is specified as a 32-bit value that identifies the human language preferred by a user, region, or application. If this item metadata is not specified, the task uses a default locale identifier of "0".
WrapperToolOptional item metadata.

Specifies the wrapper tool that is used to generate the assembly wrapper for this type library. If this item metadata is not specified, the task uses a default wrapper tool of "tlbimp". The available, case insensitive choices of typelibs are:

- Primary: Use this wrapper tool when you want to use an already generated primary interop assembly for the COM component. When you use this wrapper tool, do not specify a wrapper output directory because that will cause the task to fail.
- TLBImp: Use this wrapper tool when you want to generate an interop assembly for the COM component.
- AXImp:Use this wrapper tool when you want to generate an interop assembly for an ActiveX Control.

The following table describes the item metadata available for items passed to the TypeLibFiles parameter.

MetadataDescription
WrapperToolOptional item metadata.

Specifies the wrapper tool that is used to generate the assembly wrapper for this type library. If this item metadata is not specified, the task uses a default wrapper tool of "tlbimp". The available, case insensitive choices of typelibs are:

- Primary: Use this wrapper tool when you want to use an already generated primary interop assembly for the COM component. When you use this wrapper tool, do not specify a wrapper output directory because that will cause the task to fail.
- TLBImp: Use this wrapper tool when you want to generate an interop assembly for the COM component.
- AXImp: Use this wrapper tool when you want to generate an interop assembly for an ActiveX Control.
System_CAPS_ICON_note.jpg Note

The more information that you provide to uniquely identify a type library, the greater the possibility that the task will resolve to the correct file on disk.

In addition to the parameters listed above, this task inherits parameters from the Task class. For a list of these additional parameters and their descriptions, see Task Base Class.

Tasks
Task Reference

Show: