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
1
vote
0 answers

Using AppDomainSetup.ShadowCopyDirectories in IIS

I've got a ton of DLLs used by my website. Most of them never change, but I frequently change 1 of them. Every time I do the site is down for about 5 minutes while IIS restarts. I'd like to reduce this. I've read about shadow copying being slow…
Brian Heward
  • 524
  • 4
  • 14
1
vote
0 answers

Shadow copy in c# wpf is not copying my c++ dlls (unmanaged code)

I have an application in wpf c# which uses c++ dlls also. When I try to update this application using AppDomain and setting ShadowCopyFiles to true, it creates a cache folder and my application launches from there. However it does not copy my c++…
Sonal
  • 1,188
  • 2
  • 8
  • 10
1
vote
1 answer

Strange CMD errors only when CMD is opened from my program

This is a weird one for sure. If I open a command prompt window directly (searching cmd in start, right click > open command window here, cmd within bat file, etc....) all commands entered run perfectly fine. If I open a command prompt window from…
mrg95
  • 2,371
  • 11
  • 46
  • 89
1
vote
0 answers

Shadowcopy of AppDomain does not updating referenced dll

We have a main application (Winforms) with several dll's referenced containing Logic and UI Layers. After some research on how to perform auto-update in a winforms application, I found a solution using AppDomain and the ShadowCopies feature. Another…
JotaSantana
  • 33
  • 1
  • 6
1
vote
1 answer

Programmatically copy in-use files

In my C# code I want to be able to use some Shadow Copy mechanism in order to copy files that are being used by another process. I've seen that solutions exist on the web, in enterprise or command line tools. But could it be done programmatically in…
Mugen
  • 8,301
  • 10
  • 62
  • 140
1
vote
1 answer

ASP.NET 4 App dll is shadow copied but bin dll is loaded instead

Having a very odd issue with a large asp.net 4 application. IIS will sometimes load modules not from the shadow copy location but instead the bin directory where the dlls are originally sourced from. Does anyone know how the IIS module loading…
Marc Armstrong
  • 266
  • 3
  • 11
1
vote
1 answer

volume shadow copy vs data protection manager

trying to implement a VSS backup solution similar to what is described here: Volume Shadow Copy (VSS) there is a new offering called data protection manager: http://www.microsoft.com/systemcenter/dataprotectionmanager/en/us/overview.aspx how…
JMS77
  • 558
  • 2
  • 5
  • 13
1
vote
1 answer

Recomposition not reloading part

A bit of a long story... sorry. I am using the example from PartUpdatesInPlace and changing the code so that I can reload Extensions1.dll after deleting it from the Extensions path. I set a breakpoint after deleting Extensions1.dll, change Bar it…
roundcrisis
  • 17,276
  • 14
  • 60
  • 92
1
vote
1 answer

Anyone able to work with shadow copy from a .Net app running on Vista?

The background information, libraries and sample code on the Joe Lynds site is really helpful and works fine with XP. There are also other code samples around to help with XP shadow copy. Advice on using shadow copying from a .NET app running on…
hawbsl
  • 15,313
  • 25
  • 73
  • 114
1
vote
0 answers

Nunit shadow copy dbghelp.dll issue

To ensure that my C# and MC++ application uses a defined version of the dbghelp.dll (from the Debugging Tools) I put it in the appliation directory where all assemblies reside. This works fine on machines which have an older version or even a newer…
Harry13
  • 733
  • 1
  • 4
  • 15
1
vote
2 answers

RegLoadKey to a hive file from within a Shadow copy

I'm creating a shadow copy and I want to mount a registry hive from that shadow copy using RegLoadKey() so I go over its content using the normal registry functions. This usually works well except in certain machines where it doesn't work at all. I…
shoosh
  • 76,898
  • 55
  • 205
  • 325
0
votes
1 answer

VB.Net: How To Display Previous Shadow Copy Versions of File Allowing User to Choose One

I'm writing an Excel file recovery program with VB.Net that tries to be a convenient place to gather and access Microsoft's recommended methods. If your interested in my probably kludgy, error filled, and lacking enough cleanup code it's here:…
socrtwo
  • 122
  • 1
  • 12
0
votes
1 answer

Exclude Folders from .NET ShadowCopy

I found out about the new Feature from .NET 6 and onwards "Shadow Copy". With just enabling it and setting a Folder for the Shadow copy, the whole Application Folder is copied. If my Application has some Files inside this Folder which dont need to…
matrixPill
  • 59
  • 6
0
votes
0 answers

Word and Excel VSTO-AddIns huge startup loading time because DLLs are scanned by Windows Defender

So far we experienced this issue on different Windows Server 2016 Standard x64 systems (we use it as a terminal server) and the problem seems to exist since January/February 2023. The customers use MS Office 2016 32 Bit. Loading VSTO AddIns when…
0
votes
0 answers

Problem with ShadowCopy, error 0x80042306

I have a problem with the Shadow Copy. Specifically, when I try to set up a Shadow Copy of a given volume, error 0x80042306 appears. Additionally, there is no possibility to choose a Shadow Copy for the same volume, I simply cannot select my own…