# error MSB3027: Could not copy "obj\...\App.dll" to "bin\...\App.dll". Exceeded retry count of 10. The file is locked by: "App (1234)"

**Code:** `MSB3027` · **Category:** .NET · **Seen on:** .NET

The build can’t overwrite the output DLL/EXE because the app (or IIS Express, a test runner, antivirus) is still running and holds it.

## Meaning

Stopping the debugger without stopping the process, dotnet watch, background test hosts or IIS Express keep files locked. MSB3021 is the same issue.

## Common causes

- App still running (orphaned process, dotnet watch)
- IIS Express/test host holding the DLL
- Antivirus/indexer scanning bin/

## Quick fix

1. Stop the process named in the message
2. Close IIS Express / kill testhost
3. Exclude bin/obj from antivirus scanning

## Detailed fix by platform

### Shell

1. 

```csharp
taskkill /F /PID 1234
dotnet build-server shutdown
```


## How to diagnose

1. **Locker** — Process named in the error
2. **Watchers** — dotnet watch running?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/dotnet/msb3027-could-not-copy-file-locked)
