473,807 Members | 2,853 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.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
Nov 18 '05 #1
2 1465
ICE:

You could watch the directory with a FileSystemWatch er 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.Curre ntDomain.SetSha dowCopyPath(
AppDomain.Curre ntDomain.SetupI nformation.Shad owCopyDirectori es +
";" +
"[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.Curre ntDomain.SetupI nformation.Shad owCopyDirectori es

AppDomain.Curr entDomain.SetSh adowCopyPath(Sy stem.IO.Path.Ge tDirectoryName( Libreria))

If Not AppDomain.Curre ntDomain.Shadow CopyFiles Then
AppDomain.Curr entDomain.SetSh adowCopyFiles()

'Carico libreria

Assbly = [Assembly].LoadFrom(Libre ria)

'Ripristino dirs shadowcopy originali

AppDomain.Curr entDomain.Clear ShadowCopyPath( )

AppDomain.Curr entDomain.SetSh adowCopyPath(Ba ckup)

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 FileSystemWatch er 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
7435
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 System.Reflection.Assembly.GetExecutingAssembly().Location. This worked fine on my computer, but for another user, it failed because the assembly was being loaded using a shadow copy of the DLL located in a different directory. Is there a way,...
4
4223
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 our application framework assembly. It has no life of its own - it's designed to provide components that are glued together by another, main application assembly - let us call it APP. Thus, APP uses APPFX, and APP is registered with ASP.NET as a...
0
1751
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 a day as a user changes the underlying code. Each time the assembly is compiled it's version is updated e.g. from 1.0.0.1 to 1.0.0.2 and so on. The assemby is compiled into a directory which has been setup to shadow copy using the...
2
2695
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 the /bin/ directory if it determines that they are newer than the version already there, and loads the copy. This then takes advantage of Shadow Copying, so the DLLs never get locked. This is all fine, but the very first time I put a new DLL...
1
1321
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 in winxp which is necessary for backup and restore. Is ot possible to do backup and restore with non-persistent shadow copy in winxp?
2
2261
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 Restarts". You talked about "Drain Stopped" and "Shadow Copy" concepts in this article. I maintain a web application which is in production. Every morning the way we build the project is using Visual Studio's IDE to use "Build -> Build<proj-name>"...
0
1729
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 Photo. Any suggestions on how to solve this? i can't do much at the moment. Server Error in '/PhotoGallery' Application. -------------------------------------------------------------------------------- Cannot create/shadow copy 'Photo' when...
1
8926
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 Photo. Any suggestions on how to solve this? i can't do much at the moment. Server Error in '/PhotoGallery' Application. -------------------------------------------------------------------------------- Cannot create/shadow copy 'Photo' when...
0
2814
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 file arleady exists" error.
0
9599
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10626
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10374
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9193
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3854
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.