Questions tagged [shadow-copy]

Shadow copying enables assemblies that are used in an application domain to be updated without unloading the application domain. This is particularly useful for applications that must be available continuously, such as ASP.NET sites.

From MSDN

Shadow copying enables assemblies that are used in an application domain to be updated without unloading the application domain. This is particularly useful for applications that must be available continuously, such as ASP.NET sites.

The common language runtime locks an assembly file when the assembly is loaded, so the file cannot be updated until the assembly is unloaded. The only way to unload an assembly from an application domain is by unloading the application domain, so under normal circumstances, an assembly cannot be updated on disk until all the application domains that are using it have been unloaded.

When an application domain is configured to shadow copy files, assemblies from the application path are copied to another location and loaded from that location. The copy is locked, but the original assembly file is unlocked and can be updated.

89 questions
108
votes
2 answers

Creating a shadow copy using the "Backup" context in a PowerShell

I am in the process of writing a PowerShell script for backing up a Windows computer using rsync. To this end, I am attempting to use WMI from said script to create a non-persistent Shadow copy with writer participation (as is apparently recommended…
Julien Picalausa
  • 1,189
  • 1
  • 7
  • 3
25
votes
2 answers

How to make my dll loadable from codebase only?

My project(some kind of processing engine) is separated into 2 dlls: one with interface declarations and one with functionality.Usually the project is used by external Delphi project via COM technology. Lets say my program slices fruits. External…
Shelest
  • 660
  • 8
  • 19
24
votes
1 answer

Windows VSS: difference between two shadow copies?

I'm using the VSS api to create some shadow copies of a volume and then access them using their UNC paths. Is it possible to get a list of some sort of just the things that changed between two consecutive shadows? The obvious way of doing this is…
shoosh
  • 76,898
  • 55
  • 205
  • 325
17
votes
5 answers

Self-update / shadow-copy with Asp.Net Core

I'm writing a Asp.Net Core application which should be able to update itself (replace its own binaries while running). This MSDN article describes shadow copying with the classical .Net framework, which would be exactly what I need. But the whole…
Robert Hegner
  • 9,014
  • 7
  • 62
  • 98
16
votes
2 answers

ASP.Net cannot create/shadow copy in PRODUCTION

We've recently updated a fairly large ASP.NET website (~1500th alexa traffic ranking) to use VS2010 and .NET 4.0 running on Windows Server 2008 R2 Since then, when we deploy new versions of the site we occasionally noticed the same error in this…
13
votes
6 answers

Best method for implementing Self-Updating Software

We have a minimal 'updater' exe that checks a remote URL for updates, downloads them and replaces files on disk prior to launching the real application. However if we want to replace the updater EXE then AFAIK we have two options: Shadow Copying…
redcalx
  • 8,177
  • 4
  • 56
  • 105
12
votes
4 answers

Getting the desired / correct assembly path while unit testing with NUnit

I just started experimenting moq for unit testing my modules. Actually, the class for which I have to write an unit test uses Assembly.GetExecutingAssembly().Location internally to determine a path. But, this doesn't work while writing unit tests…
12
votes
3 answers

MEF and ShadowCopying DLLs so that I can overwrite them at runtime

I am trying to stop my application locking DLLs in my MEF plugin directory so that I can overwrite the assemblies at runtime (note I'm not actually trying to have MEF reload them on the fly, at the next app start is fine, i just dont want to have to…
undefined
  • 33,537
  • 22
  • 129
  • 198
9
votes
1 answer

What does ShadowCopyFiles property in appdomain does?

I know when you set to true ,it will shadow copy the files.But what does shadow copy mean and why we need to shadow copy files?
Ybbest
  • 1,520
  • 3
  • 29
  • 43
9
votes
2 answers

What is the right way to set shadow copying for the default AppDomain

Relating to Can I make the default AppDomain use shadow copies of certain assemblies?, it describes a working solution to activate shadow copying within the default AppDomain for a specific directory. Basically it says to use these simple…
Bluesky
  • 103
  • 1
  • 1
  • 6
7
votes
3 answers

Opening a file's Shadow Copy if the current copy is in use

I'm trying to backup files on a server, but some of them are in use and cannot be opened. Instead, I'd like to open their shadow copy if the current copy is in use. How can I do this? For reference, I'm using C# .net 3.5.
Malfist
  • 31,179
  • 61
  • 182
  • 269
7
votes
0 answers

Add shadow copy directory to ASP.NET AppDomain

I already saw THIS and THIS question, but they are both a few years old and in my case there is maybe another solution at all: I have an ASP.NET MVC 5 application with a plugin system based on THIS. So my ~/bin folder is shadow copied by the…
Christoph Fink
  • 22,727
  • 9
  • 68
  • 113
6
votes
1 answer

Add directories to ASP.NET shadow copy via webconfig

Is there anyway to mark a folder (other than Bin folder) to be shadow copied by adding some configurations in web.config ? I don't think Application_Start be a good place for setting up AppDomainSetup.ShadowCopyDirectories because at that point…
Xaqron
  • 29,931
  • 42
  • 140
  • 205
6
votes
1 answer

Assembly locking rules and when is shadow copy useful?

from what I've understood so far, by reading this doc for instance : http://msdn.microsoft.com/en-us/library/ms404279.aspx, Shadow copy is a feature that allows the use of an assembly while currently loaded by an application. From the above doc…
Pragmateek
  • 13,174
  • 9
  • 74
  • 108
6
votes
6 answers

Windows Volume shadow copy error: 2155348129

Developing a VSS writer app: see this error during backup, initiated by windows backup tool, is there defined error codes for 2155348129 from Microsoft? The backup operation that started at '‎2010‎-‎07‎-‎20T02:54:19.354000000Z' has failed because…
JMS77
  • 558
  • 2
  • 5
  • 13
1
2 3 4 5 6