If you collect the Process Monitor log during the failure, it shows a SHARING VIOLATION error that resembles the following during logoff:
process name PID TID Path
svchost.exe 1244 WriteFile 3024 C:\Users\TestUser1\AppData\Local\TileDataLayer\Database\vedatamodel.edb SUCCESS Offset: 319,488, Length: 4,096, I/O Flags: Write Through, Priority: Normal
svchost.exe 924 CreateFile 1696 C:\Users\TestUser1\AppData\Local\TileDataLayer\Database\vedatamodel.edb SHARING VIOLATION Desired Access: Read Attributes, Delete, Disposition: Open, Options: Non-Directory File, Open For Backup, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, Impersonating: NT AUTHORITY\SYSTEM
svchost.exe 924 CreateFile 1696 C:\Users\TestUser1\AppData\Local\TileDataLayer\Database\vedatamodel.edb SHARING VIOLATION Desired Access: Read Attributes, Delete, Disposition: Open, Options: Non-Directory File, Open For Backup, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, Impersonating: NT AUTHORITY\SYSTEM
svchost.exe 924 CreateFile 1696 C:\Users\TestUser1\AppData\Local\TileDataLayer\Database\vedatamodel.edb SHARING VIOLATION Desired Access: Read Attributes, Delete, Disposition: Open, Options: Non-Directory File, Open For Backup, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, Impersonating: NT AUTHORITY\SYSTEM
svchost.exe 924 CreateFile 1696 C:\Users\TestUser1\AppData\Local\TileDataLayer\Database\vedatamodel.edb SHARING VIOLATION Desired Access: Read Attributes, Delete, Disposition: Open, Options: Non-Directory File, Open For Backup, Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, Impersonating: NT AUTHORITY\SYSTEM
svchost.exe 1244 QueryDirectory 1176 C:\Users\TestUser1\AppData\Local\TileDataLayer\Database\vedatamodel.edb SUCCESS Filter: vedatamodel.edb, 1: vedatamodel.edb
Note PID 1244 is TileDatamodelsvc, and PID 924 is profsvc. Here you can see that TileDatamodelsvc PID 1244 has a lock on the vedatamodel.edb file and is writing to it when profsvc tries and fails to delete the files. You can also see that svchost.exe 1244 is still writing the file
after the profile unload
is finished.