3

I'm using the Nuget package System.Data.SQLite in an MVC desktop application. I get an error when I try to clean the solution. The error message I get is: Unable to delete file "...bin\Debug\x64\SQLite.Interop.dll". Access to the path '\bin\Debug\x64\SQLite.Interop.dll' is denied.

This is nearly the same question that was asked here, but because I just created my SO account, I am unable to add my comment there.

I am using the NuGet packages System.Data.SQLite and System.Data.SQLite.Core on my database project and System.Data.SQLite.Core on my UI project.

I created a button to Terminate IIS process as suggested in one of the answers, but since I am unable to build my project, I cannot test if this works.

I was able to clean/ build just fine yesterday. I wonder whether repeatedly debugging has created this issue.

Community
  • 1
  • 1
dmdh
  • 33
  • 5
  • [This](http://stackoverflow.com/questions/22514397/automatically-kill-iis-express-process-after-debugging-vs-express-2013-web/22514442#22514442) didn't work? – IronAces Apr 24 '17 at 15:37
  • @DanielShillcock No, it didn't. But Scott Chamberlain's answer below helped me find the process that was using the dll and I was able to kill that process. – dmdh Apr 24 '17 at 15:52

1 Answers1

2

Something has a handle to that DLL open, if it is not IIS Express it is something else. When I am in that situation I use Process Explorer from Microsoft and click the search button and search for the path of the file. I can then click on the search result and end task from inside Process explorer.

Here is a example searching for who has the file c:\agent\bin\clrjit.dll open.

enter image description here

I could then right click on Agent.Listener.exe and do "Kill Process"

For your case you would search for bin\Debug\x64\SQLite.Interop.dll

Scott Chamberlain
  • 124,994
  • 33
  • 282
  • 431
  • Scott Chamberlain: The Process Explorer helped me locate the culprit. Somehow I had an instance of the desktop application that was running in the background without being visibly open. Thanks! I upvoted your answer, but it doesn't show because of my new status. Thanks again! – dmdh Apr 24 '17 at 15:50