G
Guest
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.CurrentDomain.SetupInformation.ShadowCopyDirectories
AppDomain.CurrentDomain.SetShadowCopyPath(System.IO.Path.GetDirectoryName(Libreria))
If Not AppDomain.CurrentDomain.ShadowCopyFiles Then
AppDomain.CurrentDomain.SetShadowCopyFiles()
'Carico libreria
Assbly = [Assembly].LoadFrom(Libreria)
'Ripristino dirs shadowcopy originali
AppDomain.CurrentDomain.ClearShadowCopyPath()
AppDomain.CurrentDomain.SetShadowCopyPath(Backup)
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
application:
Private Function CaricaLibShadow(ByVal Libreria As String) As [Assembly]
Dim Backup As String
Dim Assbly As [Assembly]
Backup = AppDomain.CurrentDomain.SetupInformation.ShadowCopyDirectories
AppDomain.CurrentDomain.SetShadowCopyPath(System.IO.Path.GetDirectoryName(Libreria))
If Not AppDomain.CurrentDomain.ShadowCopyFiles Then
AppDomain.CurrentDomain.SetShadowCopyFiles()
'Carico libreria
Assbly = [Assembly].LoadFrom(Libreria)
'Ripristino dirs shadowcopy originali
AppDomain.CurrentDomain.ClearShadowCopyPath()
AppDomain.CurrentDomain.SetShadowCopyPath(Backup)
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