To get assembly information, you would be better off using the AssemblyName
class:
Private Function GetAsmVersion( _
ByVal sAssemblyFileName As String) As String
Dim asmName = _
AssemblyName.GetAssemblyName(sAssemblyFileName)
Return asm.Version.ToString
End Function
GetAssemblyName loads the file, extracts the information and then closes
back the file. The assembly is not loaded into the app domain and so you
don't have to deal with unloading it from the app domain.
hope that helps..
Imran.
"Henrik Nordgren" <He************@discussions.microsoft.com> wrote in
message news:A2**********************************@microsof t.com...
I have a problem... A webservice I built check the version of an assembly
by using this code:
app = [Assembly].LoadFrom(Server.MapPath(appName & "\" & assemblyName))
' Return it's version
Return app.GetName.Version.ToString
when another app is uploading a new version of that file I get a
securityexception stating the file is in use...
The ony code i have that accesses that file is the above code... so what
is going on?
I can't unload an assembly without disposing the entire app domain...
/Henrik