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
6
votes
1 answer

Why AppDomain.ShadowCopyFiles is string?

There is ShadowCopy functionality in .Net to preserve file locking by copying assemblies. There are two properties: AppDomain.ShadowCopyFiles that uses AppDomainSetup AppDomainSetup.ShadowCopyFiles that stores it in internal…
Sergey Litvinov
  • 7,408
  • 5
  • 46
  • 67
5
votes
1 answer

bin/*.dll locked when deploying website after app_offline.htm copied and active (shadow copy off)

I am running into an issue deploying a website. Shadow copy is turned off after previous deployment issues with it and deploying the site. Specifically at deploy time I find that even after copying app_offline.htm and verifying that the…
scubadam
  • 61
  • 4
4
votes
3 answers

Shadow copy with AppDomain to overwrite exe at runtime

In the following sample app I create a new AppDomain and I execute it with shadow copy enabled. From the new AppDomain I then try to delete (replace) the original main exe. However I get an "access is denied error". Interestingly, after launching…
Mauro Ganswer
  • 1,379
  • 1
  • 19
  • 33
4
votes
1 answer

Assemblies Failing to load in shadow copied AppDomain

I write the xunit.net test runner for ReSharper, and I've got an issue in the 8.0 release - I'm seeing assemblies failing to load in a shadow copied AppDomain. The same code and test project work fine in the 7.1 release. I don't understand why,…
citizenmatt
  • 18,085
  • 5
  • 55
  • 60
4
votes
5 answers

Strange, possible “shadow copy” issue where two editors show different contents

I have some code that is reading a config file, but when I open the file in TextPad, I see different values than my application does. I checked it with Notepad. Notepad agrees with my application, TextPad shows something else. This is on Vista x64…
Neil Barnwell
  • 41,080
  • 29
  • 148
  • 220
3
votes
2 answers

Volume Shadow Copy (VSS)

Can anyone clarify an issue? I'm using the VSS API (C++ using VSS2008 and the latest SDK running on XP SP3) in a home-brew backup utility*. THe VSS snapshot operations work fine for folder that have no subfolders - i.e. my email and SQL server…
J Evans
  • 1,090
  • 2
  • 16
  • 36
3
votes
1 answer

AppDomain shadow copying not working (original assemblies locked)

Here's a small class I'm using to probe for a list of available plugins: internal static class PluginDirectoryLoader { public static PluginInfo[] ListPlugins(string path) { var name = Path.GetFileName(path); var setup = new…
Nathan Ridley
  • 33,766
  • 35
  • 123
  • 197
3
votes
3 answers

Help needed with unloading .DLL's from AppDomain - Still not working even with ShadowCopy

I am trying to do the following. App A is the "mother app". It stays open. App B is just a .DLL where I write some classes that are derived from an interface specified in App A. Then, from App A, I will "import" classes from App B and run methods…
philmo
  • 205
  • 3
  • 7
3
votes
1 answer

Is it safe to manually copy native DLLs to a Shadow Copy directory?

I'm using the Microsoft.SqlServer.Types library in an ASP.NET application. The library depends on a native DLL that has to be loaded with LoadLibrary() via P/Invoke. The documentation of the library suggests loading the native DLL from…
user247702
  • 23,641
  • 15
  • 110
  • 157
3
votes
1 answer

Add directories to ASP.NET shadow copy

In my ASP.NET app, I'm attempting to add another directory to be have the DLLs in it shadow copied. The only method I found that will allow m to do this is AppDomain.CurrentDomain.SetShadowCopyPath. However, this method is marked as Obsolete. MSDN…
Omar
  • 39,496
  • 45
  • 145
  • 213
3
votes
1 answer

Backup from shadow copy

So, I want to make backups from the shadow-copy using batch-script. That's what I have so far: vssadmin list shadows | findstr /C:"Volume da Cópia de Sombra" Output: Volume da Cópia de Sombra: \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1 …
Rafael
  • 634
  • 1
  • 6
  • 13
3
votes
2 answers

Shadow Copying, and mixed C# and C++ DLLs loading from arbitrary folders

I have a VS 2005 C# project that uses a special Plugin folder to load extra DLLs (for use as nodes in an asset conversion process). I have a mixture of C# and C++ DLLs in this folder. The issue I have is that when Shadow Copying is enabled, the C++…
user35444
  • 31
  • 2
3
votes
1 answer

Start WCF service in a new AppDomain to enable shadow copy (Windows Service hosted)

I have a WCF service library (MyWCFService), which uses MEF to load plugins and hosted by Windows services (All .NET 4.0). I am now trying to run it in a new AppDomain and to enable ShadowCopyFiles in a hope that I can update plugins in the runtime.…
Bolu
  • 8,696
  • 4
  • 38
  • 70
3
votes
1 answer

How do I turn off shadow copy in a Visual Studio 2010 test project?

When using NUnit, I can turn off shadow copy so that my test assemblies are run from the output directory. I need this because my tests in this case aren't unit tests, but are integration tests which need to be able to access some of the assemblies…
Duncan Bayne
  • 3,870
  • 4
  • 39
  • 64
3
votes
0 answers

Specify Shadow Copy location in configuration

On my development machine, I have a slow system disk (SSD) and a fast (RAM Disk) development disk. Once Visual Studio is up and running, the develop/build/test cycle is extremely fast, but application start is much slower [I believe] because of the…
Matt Mills
  • 8,692
  • 6
  • 40
  • 64