SourceForge.net Logo

Home
StructureMap on SourceForge
Basic Architecture
Concepts
API Documentation
FAQ
Configuration Schema
    Memento Sources
    Node Normalized Xml
    Attribute Normalized Xml
    Attribute Usage
    Instance Lifecyle Scoping
Configuration Management
    StructureMapDoctor
    StructureMapExplorer
    deployment Task
    verification Task
    ValidationMethod Attribute
    Other NAnt Tasks
Troubleshooting
Singleton Injection

"structuremap.verification" NAnt Task

The custom "structuremap.verification" NAnt task is used to check a StructureMap configuration file during a NAnt build process.  The step can be used to test and validate an application's configuration.  The step will output a report of any errors found in the configuration.  This step will also try to construct every configured instance to test for runtime errors. This runtime checking can also be extended via a custom attribute to call methods on the created instances to do further validation.

Usage

The requirements for usage are simple.  The StructureMap.dll and StructureMap.DeploymentTasks.dll must be in the search path for the NAnt executable.  The only input is the path to the configuration file.  StructureMap assumes that all assemblies are in the same folder as the configuration file.  StructureMap creates a new AppDomain to load the targeted assemblies and classes during verification with the binary path set to the folder containing the configuration file.  The StructureMap.dll file must also be in this folder. 

<target name="verifyConfiguration">
<structuremap.verification configPath="C:\MyApp\StructureMap.config" />
</target>