Issue with enableShadowCopy and shared shadowCopyDirectory in Multi-Environment Deployment #50531
Labels
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Milestone
While deploying an ASP.NET Core application, I encountered file locking issues. I discovered the enableShadowCopy parameter, which seemed to address these concerns.
However, the documentation around this feature is lacking, with no detailed information on its functionality, prerequisites, etc.
The reference I followed is here.
Configuration:
I have an application deployed across multiple pools on the same machine, simulating multi-environment deployment. All application folders are structured at the same level. I've set up shadow copying as shown in the documentation:
There's no indication in the documentation that the shadowCopyDirectory should be unique for each app, so I used a shared directory.
Issues Encountered:
Soon after, we started observing problems related to missing DLLs and received errors like:
Upon investigation, I found a concerning code segment in the ASP.NET Core source. This segment deletes ALL subdirectories within the user-defined shadowCopyDirectory, which is risky. In our deployment, it led to shadow copy directories unintentionally deleting one another.
Here's the concerning code:
ASP.NET Core Source.
Please consider revising this behavior or, at a minimum, provide clear documentation on the potential risks and the necessity of unique shadow copy directories for each application.
The text was updated successfully, but these errors were encountered: