I use this function to load some assemblies from a directory into ASP.Net
application:
Private Function CaricaLibShadow (ByVal Libreria As String) As [Assembly]
Dim Backup As String
Dim Assbly As [Assembly]
Backup = AppDomain.Curre ntDomain.SetupI nformation.Shad owCopyDirectori es
AppDomain.Curre ntDomain.SetSha dowCopyPath(Sys tem.IO.Path.Get DirectoryName(L ibreria))
If Not AppDomain.Curre ntDomain.Shadow CopyFiles Then
AppDomain.Curre ntDomain.SetSha dowCopyFiles()
'Carico libreria
Assbly = [Assembly].LoadFrom(Libre ria)
'Ripristino dirs shadowcopy originali
AppDomain.Curre ntDomain.ClearS hadowCopyPath()
AppDomain.Curre ntDomain.SetSha dowCopyPath(Bac kup)
Return Assbly
End Function
This work fine letting me loading any assembly in shadow copy so that I can
copy a new version of it over the old one even when the application is
working. The problem is that after I do the copy any new or old application
using that assembly see the old version until I restart IIS. I'd like to know
if I do something wrong and there's a way to make the new version visible
right away.
Thanks in advance.
ACL