Recycling and Shadow Copy combined lead to race condition, new instance fails to start, error code 0x8000ffff
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 276
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
We have an ASP.NET Core application, where app pool recycling and shadow copy functionality do not play well together, finally leading to the app NOT running at all after the recycling.
I've attached useful logs showing the different instances starting and being stopped and the shadow copy functionality "doing stuff".
Sometimes recycling works, sometimes it does not (with no incoming traffic, there is no problem; but with incoming requests, the problem can occur).
We had the problem right from the beginning (then .NET 9). It did not improve with .NET 10 (which we use now).
Note that our shadow copy directory is a _sibling_ of the content root (it is _not_ inside the watched folder)
[aspnetcore-debug with failed recycling 2.log](https://github.com/user-attachments/files/31135326/aspnetcore-debug.with.failed.recycling.2.log)
### Expected Behavior
While recycling and Shadow copy may lead to some lost requests and some seconds downtime (this would be totally fine), at the end, the app should be running.
### Steps To Reproduce
1. ASP.NET Core app, **in-process** hosting on IIS.
2. Enable shadow copy in web.config, directory **outside** the content root:
```
```
3. Configure app pool recycle (for e.g. 1:00 UTC), with overlapping rotation left at the default
(overlapping enabled)
4. Have a decent amount of requests on the site (we did not see the problem if there are no or only few requests coming in)
### Exceptions (if any)
```
[2026-08-16T01:00:03.452Z, PID: 1376] [aspnetcorev2.dll] Failed HRESULT returned: 0x8000ffff at D:\a\_work\1\s\src\aspnetcore\src\Servers\IIS\AspNetCoreModuleV2\AspNetCore\HandlerResolver.cpp:177
[2026-08-16T01:00:03.454Z, PID: 1376] [aspnetcorev2.dll] Failed HRESULT returned: 0x8000ffff at D:\a\_work\1\s\src\aspnetcore\src\Servers\IIS\AspNetCoreModuleV2\AspNetCore\applicationinfo.cpp:198
[2026-08-16T01:00:03.456Z, PID: 1376] [aspnetcorev2.dll] Failed HRESULT returned: 0x8000ffff at D:\a\_work\1\s\src\aspnetcore\src\Servers\IIS\AspNetCoreModuleV2\AspNetCore\applicationinfo.cpp:111
[2026-08-16T01:00:03.458Z, PID: 1376] [aspnetcorev2.dll] Event Log: 'Failed to start application '/LM/W3SVC/2/ROOT', ErrorCode '0x8000ffff'.'
```
### .NET Version
Microsoft.AspNetCore.App 10.0.11
### Anything else?
Microsoft Windows Server Version 21H2 (OS Build 20348.5499)
Internet Information Services (Version 10.0.20348.1)
```
dotnet --info
Host:
Version: 10.0.11
Architecture: x64
Commit: e2f47b0110
RID: win-x64
.NET SDKs installed:
No SDKs were found.
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 9.0.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.11 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
```
Contributor guide
Research direction
Start by reproducing the in-process IIS setup from the issue: enable shadow copy to a sibling directory, leave overlapping recycling enabled, and generate requests during recycling. Review the attached failed-recycling log alongside HandlerResolver.cpp and applicationinfo.cpp at the reported locations. Done means the application reliably starts and remains running after recycling instead of returning 0x8000ffff.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- backend, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100