Friday, July 29, 2005

Installer class gawk

There are times when you installer class in your project the installation throws an error stating dependency not found. This error does not state anything more than could not find one or more dependency of the assembly.The best way to then resolve which dependency is missing is to write a small console application that through the exception with the inner information when you try to load the specific assembly dynamically using reflection.

Example:

Dim SampleAssembly As [Assembly]
' You must supply a valid fully qualified assembly name here.
Try
SampleAssembly = [Assembly].LoadFrom("C:\Program Files\MyAssembly.dll")
Dim Types As Type() = SampleAssembly.GetTypes()
Dim oType As Type
' Display all the types contained in the specified assembly.
For Each oType In Types
Console.WriteLine(oType.Name.ToString())
Next oType
Catch ex As Exception
Console.WriteLine(ex.InnerException)
End Try

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home