On certain assemblies, when I do a LoadFrom to get a reference, and
then call GetTypes to get a list of types, the application freezes.

If, however, I put a try/catch block around the code, it does NOT
freeze, but NO EXCEPTION is thrown.

This is for my plugin structure. I have 30 dlls to search. The
first 10 are ok. #1, which is not much different than the other 10,
fails. Ok.. so I skip that one manually.. 11-16 work, 17 fails.

I figured I would inspect the failing ones and see why. There is no
common bond.

Also, one more thing.. this seems to work successfully, for all DLLs
on most machines, but one a couple of clients reporting a problem.

Anyone have any advice?

Here is the code. FINDPLUGINS is the routine I call....

Public Shared Function FindPlugins(ByVal szPath As String, _
Optional ByVal
objHostInitialize As ITPPHost = Nothing) As AvailablePlugin()
Dim objArrayPlugins As ArrayList = New ArrayList
Dim szDLLs() As String, nIndex As Integer
Dim objDLL As [Assembly]
Dim szInterface As String = GetType(ITPPPlugIn).ToString()

'Go through all DLLs in the directory, attempting to load them
szDLLs = Directory.GetFileSystemEntries(szPath, "*.dll")
For nIndex = 0 To szDLLs.Length - 1
Try
Dim szFileName As String =
System.IO.Path.GetFileName(szDLLs(nIndex))
If Not szFileName.StartsWith("ActiveReports") Then
objDLL = [Assembly].LoadFrom(szDLLs(nIndex))
ExamineAssembly(objDLL, szInterface,
objArrayPlugins, objHostInitialize)
End If
Catch e As Exception
'Error loading DLL, we don't need to do anything
special
End Try
Next

'Return all objArrayPlugins found
Dim Results(objArrayPlugins.Count - 1) As AvailablePlugin

If objArrayPlugins.Count <> 0 Then
objArrayPlugins.CopyTo(Results)
Return Results
Else
Return Nothing
End If
End Function

Private Shared Sub ExamineAssembly(ByVal objDLL As [Assembly], _
ByVal szInterface As String, _
ByVal objArrayPlugins As
ArrayList, _
ByVal objHost As ITPPHost)
Dim objType As Type
Dim objInterface As Type
Dim objAP As AvailablePlugin

Try
'Loop through each type in the DLL
For Each objType In objDLL.GetTypes
'Only look at public types
If objType.IsPublic = True Then
'Ignore abstract classes

If Not ((objType.Attributes And
TypeAttributes.Abstract) = TypeAttributes.Abstract) Then

'See if this type implements our interface
objInterface =
objType.GetInterface(szInterface, True)

If Not (objInterface Is Nothing) Then
'It does
objAP = New AvailablePlugin
objAP.AssemblyPath = objDLL.Location
objAP.ClassName = objType.FullName

'if the host exists, then instantiate

If Not objHost Is Nothing Then
objAP.Plugin = CreateInstance(objAP, objHost)
objArrayPlugins.Add(objAP)
End If

End If
End If
Next
Catch ex As Exception
Throw ex
End Try
End Sub