Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is IIS Worker Process locking a file?

My website is setup in the D:\RW_System\RW_Webroot\BrokerOffice.Admin folder (screenshot below). It's a .NET, C# WebForms application.

For whatever reason, when I want to deploy changes to the site, I try to copy the files over, but IIS locks DLLs in the path where the site is setup:

C:\Users\rizzo\Desktop>handle64 hiqpdf

Nthandle v4.11 - Handle viewer
Copyright (C) 1997-2017 Mark Russinovich
Sysinternals - www.sysinternals.com

w3wp.exe  pid: 3700   type: File  2954: D:\RW_System\RW_Webroot\BrokerOffice.Admin\bin\HiQPdf.dll

And it's not just that .dll that's locked - it's all of the DLLs in the \bin folder. My understanding was that IIS copied everything to folder under C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\ and executed things from there.

I have a number of other sites on the box with multiple DLL references and, as expected, w3wp.exe has them locked in Temporary ASP.NET Files folder.

Is there a setting in IIS or something in my code that's causing IIS to lock the the DLLs in the /bin folder?

enter image description here

like image 452
AngryHacker Avatar asked Apr 04 '18 21:04

AngryHacker


1 Answers

Answering my own question in case someone runs into this problem. Turns out web.config file had the <hostingEnvironment shadowCopyBinAssemblies="false" /> directive, which I didn't even know existed.

This setting tells IIS to execute everything in place rather than in Temporary ASP.NET Files folder.

like image 147
AngryHacker Avatar answered Sep 21 '22 18:09

AngryHacker