Use Reflection to Validate Assembly ReferencesBefore Your Customers Do
Developers are familiar with reflection as a way to create object instances, and discover and call object properties and methods, but reflection's usefulness extends even furtheryou can also use it to create a diagnostic tool to discover and validate dependencies for deployed code, and to report missing dependencies.
by Michael Jones
June 23, 2005
eflection is truly a paradigm shift for developers using Microsoft's line of development tools. The runtime availability of assembly metadata provides developers with new flexibility and the ability to develop interesting software tools. Developers often use reflection to load assemblies and instantiate classes dynamically, or to invoke methods, but you can also use reflection to inspect assembly metadata.
That capability leads to a way to solve an often-experienced problemapplication deployment failures due to missing project dependencies on a machine. When you deploy a new .NET DLL or executable, knowing that a dependency is missing would aid greatly in fixing the problem before customers report the problem. Using reflection, you can easily build a tool to validate an assembly's dependencies and report on which ones are missing.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!