Last post Jan 08, 2018 01:52 PM by Michael R Day
Jan 05, 2018 03:20 PM|Michael R Day|LINK
I have an ASP.Net Razor web site that I've been enhancing and successfully publishing to our intranet for the
last couple of years. I recently started using VS2017 with it without any problems. Today, I encountered an error when I tried to publish it:
Error Copying file .vs\ETF\v15\Server\sqlite3\db.lock to C:\Users\myId\AppData\Local\Temp\WebSitePublish\mySite-1436350714\obj\Debug\Package\PackageTmp\.vs\ETF\v15\Server\sqlite3\db.lock
failed. The process cannot access the file '.vs\ETF\v15\Server\sqlite3\db.lock' because it is being used by another process.
I tried restarting my machine and renaming db.lock in the .vs\ETF\v15\Server\sqlite3 folder, but when I start the
project in VS and try to publish it again, it recreates db.lock file (with current timestamp), and gives me the same error. I use SQL Server in the app, but have no idea where the sqlite3 reference is coming from. Also there is no db.lock file in the destination
I can build it. We don't use Git anymore, we switched to TFS but this problem doesn't occur if I open and publish
the solution in VS2015.
Any ideas would be greatly appreciated as my online searches have been fruitless.
Jan 08, 2018 02:16 AM|AngelinaJolie|LINK
Sir, first of all, commonly, we could delete the .vs folder and it doesn't have any effort if we met any question in VS because after re-build using VS, it will be re-created again ;
and if you check your db.lock file, it should be old enough, so we need to get a new one though delete this .vs folder, then it will fix this question;
What's happening is that VS is acquiring a lock on a file and then not releasing it. that lock prevents VS itself from deleting the file so that it can recreate it when you rebuild the application. The only apparent solution is to close and restart
VS so that it will release the lock on the file.
Good Luck :)
With regards, Angelina Jolie
Jan 08, 2018 01:52 PM|Michael R Day|LINK
That worked. Thank you!