Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.Net 1.1 shadow copy problem

Reply
Thread Tools

ASP.Net 1.1 shadow copy problem

 
 
=?Utf-8?B?SUNFIFNybA==?=
Guest
Posts: n/a
 
      11-26-2004
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.ShadowCop yDirectories

AppDomain.CurrentDomain.SetShadowCopyPath(System.I O.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
 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      11-26-2004
ICE:

You could watch the directory with a FileSystemWatcher class and
restart when a new version of the assembly appears.

You might try to add your path to the shadow copy list permanently
instead of swapping it in and out (just separate it from the rest with
a ';').


AppDomain.CurrentDomain.SetShadowCopyPath(
AppDomain.CurrentDomain.SetupInformation.ShadowCop yDirectories +
";" +
"[CustomPath]"
);


HTH,

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 26 Nov 2004 01:45:02 -0800, "ICE Srl" <ICE
> wrote:

>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.ShadowCop yDirectories
>
>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(Backu p)
>
>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


 
Reply With Quote
 
 
 
 
=?Utf-8?B?aWNlc29mdHdhcmU=?=
Guest
Posts: n/a
 
      11-26-2004
Hi

First of all thanks a lot for your answer.
Then you propose to:

"Scott Allen" wrote:

> ICE:
>
> You could watch the directory with a FileSystemWatcher class and
> restart when a new version of the assembly appears.


Yes, that's an idea but unfortunately it's not an option in my case. The
point at my conmpany is to update the assemblies and have them up and running
immediately *without* restarting anything. Their concern is mostly towards
provide a quick fix to unavoidable bugs while the user don't even have to
notice, but for the fact that what didn't work orrectly a second before is
working the next time. All has to be flawlessly happening behind the scene.
So restarting is not considered acceptable.

Do you know if that is possible and where I could find some docs or samples?

ACL
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
shadow copy and deep copy Eva Ruby 2 11-09-2010 01:41 PM
Question on article by Scott about "Shadow copy of an assembly" =?Utf-8?B?RGlmZmlkZW50?= ASP .Net 2 02-02-2006 11:11 PM
Shadow Copy Assw =?Utf-8?B?RGFtaWVuIEFuc2VsbWk=?= ASP .Net 0 11-17-2005 09:25 PM
Shadow Copy a text resource file along with an assembly Kevin Frey ASP .Net 0 10-20-2005 07:44 AM
COM+ error when I do a Shadow copy Bill Joyce ASP .Net 0 09-23-2004 01:42 PM



Advertisments