473,395 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

ASP.Net 1.1 shadow copy problem

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
Nov 18 '05 #1
2 1450
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
Sr*@discussions.microsoft.com> 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


Nov 18 '05 #2
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
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bill Rust | last post by:
I have a component that needs to access files which exist in the same directory as the DLL containing the component itself. To determine the component's installation directory, I'm using...
4
by: Barry Kelly | last post by:
I'm designing an application framework which will, amongst other things, live in an assembly hosted in the ASP.NET worker process, servicing webservice requests. Here's the scenario: APPFX is...
0
by: Damien Anselmi | last post by:
I am using the CompileAssemblyFromSource method of an ICodeCompiler instance to dynamically compile an assembly used by a Web Application. The assembly may be recompiled any number of times during...
2
by: Oenone | last post by:
I have an application which loads plugin DLLs from various directories on the local disk. To avoid problems with the DLLs being locked by IIS, I have modified my code so that it copies the DLLs to...
1
by: supriya | last post by:
Hi, I found vshadow sdk in MSDN.I am unable to use the shadow copy for backup and restore because it is creating only non persistent shadow copy in winxp.How can i create persistent shadow copy...
2
by: Diffident | last post by:
Hello All, I just finished reading an interesting article by Scott about App Domains: http://odetocode.com/Articles/305.aspx Scott, I have a question about the section "Shadow Copies and...
0
by: Patrick F | last post by:
I keep getting this error message and i don't know whats the problem is and how to solve it. I have a webproject with 2 components (dll) added to it. One is called PhotoGallery and one is called...
1
by: Patrick F | last post by:
I keep getting this error message and i don't know whats the problem is and how to solve it. I have a webproject with 2 components (dll) added to it. One is called PhotoGallery and one is called...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hello, mister I have an application web asp.net 2.0 + vs 2005 and VS 2005 Web Application Project. Its appears this error in execution: "Cannot Create/Shadow Copy '<projectname>' when that...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.