S
Scott Meddows
I'm using a VB webservice to create the back end of a smart client
application. When the service loops through the directory containing all
the assemblies the application can load it seems to put a file lock on the
assemblies. Is there a way to prevent this? Posted below is the code.
Thanks
Dim f As FileInfo
Dim d As New DirectoryInfo(searchpath)
For Each f In d.GetFileSystemInfos("*.dll")
Try
Dim currentAsm As [Assembly] = [Assembly].LoadFrom(f.FullName)
Dim temptype As Type
For Each temptype In currentAsm.GetExportedTypes()
If (temptype.IsSubclassOf(basetype)) And Not
IsSubForm(temptype) Then
Dim fi As New FormInfo.FormInfo
Dim myhandler As EventHandler
fi.Name = GetName(temptype)
fi.Description = GetDescription(temptype)
fi.AssemblyName = temptype.[Module].Name
fi.TypeName = temptype.FullName
fi.UrlLocation = urlLocation
fi.ImageFile = GetImageFileName(temptype)
forms.Add(fi)
End If
Next temptype
Catch ex As Exception
Console.WriteLine(ex.ToString())
End Try
Next f
d = Nothing
application. When the service loops through the directory containing all
the assemblies the application can load it seems to put a file lock on the
assemblies. Is there a way to prevent this? Posted below is the code.
Thanks
Dim f As FileInfo
Dim d As New DirectoryInfo(searchpath)
For Each f In d.GetFileSystemInfos("*.dll")
Try
Dim currentAsm As [Assembly] = [Assembly].LoadFrom(f.FullName)
Dim temptype As Type
For Each temptype In currentAsm.GetExportedTypes()
If (temptype.IsSubclassOf(basetype)) And Not
IsSubForm(temptype) Then
Dim fi As New FormInfo.FormInfo
Dim myhandler As EventHandler
fi.Name = GetName(temptype)
fi.Description = GetDescription(temptype)
fi.AssemblyName = temptype.[Module].Name
fi.TypeName = temptype.FullName
fi.UrlLocation = urlLocation
fi.ImageFile = GetImageFileName(temptype)
forms.Add(fi)
End If
Next temptype
Catch ex As Exception
Console.WriteLine(ex.ToString())
End Try
Next f
d = Nothing