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 load any assembly in shadow copy so that I can
copy a new version of it over the old one even when the application is
running. The problem is that after I do the copy any application
using that assembly see the old version (even if I close the browser and
reopen it or use another computer to connect) until I restart IIS or cause
the aspnet_wp.exe process to be recycled.
What I would like to obtain is that the system would load the new version
immediately without having to disrupt the session state by
restarting/recycling aspnet_wp.exe thus not letting users connected realize
of the changments but for the fact that bugs disappears.
Am I doing something wrong? Is that possible?
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 load any assembly in shadow copy so that I can
copy a new version of it over the old one even when the application is
running. The problem is that after I do the copy any application
using that assembly see the old version (even if I close the browser and
reopen it or use another computer to connect) until I restart IIS or cause
the aspnet_wp.exe process to be recycled.
What I would like to obtain is that the system would load the new version
immediately without having to disrupt the session state by
restarting/recycling aspnet_wp.exe thus not letting users connected realize
of the changments but for the fact that bugs disappears.
Am I doing something wrong? Is that possible?
Thanks in advance.
ACL