SmartAssembly - 5.0

SmartAssembly
DRAFT:   Help content is still under construction.

Learning SmartAssembly - 5.0

Searching for dependencies

This topic provides information on how you can use SmartAssembly to search for dependencies.

To locate and load a dependency, SmartAssembly does the following:

  1. Searches the GAC (Global Assembly Cache) for an assembly with the exact same version and public key token.
  2. If not found in the GAC, SmartAssembly looks into the framework folder and associated folders (for SDKs, Silverlight, XNA, etc.).
  3. If not found in the framework folder, SmartAssembly looks into the main assembly folder for a dependency with a similar assembly name (even if version and/or public key token is different).
  4. Finally, SmartAssembly looks into any search folders that you have specified. These folders are listed in smartassembly.settings.

You can override the normal behavior by manually entering values for the following attributes in the SmartAssembly project file (*.saproj):

<MandatoryPath>

If a value is present for this attribute, it overrides anything else to find the assembly. SmartAssembly always uses the assembly found at this location.

For example:

<Assembly AssemblyName="dependency_assembly_name" MandatoryPath="C:\path\DependencyToUse.dll">... </Assembly>

Note that if the value specified in this attribute is not valid (such as, file not found, invalid assembly, assembly with a different assembly name), then SmartAssembly refuses to process your assembly and reports an error.

<HintPath>

If SmartAssembly cannot find the assembly, the <HintPath> attribute is used.

For example:

<Assembly AssemblyName="dependency_assembly_name" HintPath="C:\path\MyDependency.dll">... </Assembly>

DRAFT:   Help content is still under construction.

Was this article helpful?

Search support
Forums
Visit the SmartAssembly forum.

SmartAssembly

all products