New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deployment fails due to file in use #3719
Comments
@fubar-coder By design, ASP.NET Core locks file in use. The guidance on our part is to use Through the various issues reported on the linked thread, we've improved the robustness of this feature. (I'll concede we haven't done a good job communicating it). If you are still seeing file locking issues, we need a repro to help further investigate what is going on. Are you deploying to Azure App Service? If not, can you provide the file versions for both ANCM ( |
The last time I saw this kind of error was while deploying from a Win 10 Pro (1803) to an IIS on a Windows Server 2012R2. The installed WebDeploy has the file version 7.1.1973.0. I guess that it would be useful to ask the other people in the old thread too. I created this new thread out of despair to increase this problems visibility. |
Can you share the aspnetcore.dll file version as well? |
@shirhatti It's 8.2.1991.0 |
Is it possible to stop the website first, deploy, and start the website again? I did this for our site on Azure App Service using an Azure DevOps release pipeline. |
I provide some help on a community forum and, occasionally, there are people complaining about how ASP.NET Core is advertised as a modern framework and all, and then its publishing story is sub-optimal. And they're absolutely right.
@shirhatti And that's fine, but you'll seriously have to consider a solution for us IIS people who want to achieve 0 downtime when updating our application. Not everyone lives in the Azure part of town and I don't want to be considered as a second-class citizen. Here's a suggestion: support deployment slots in ASP.NET Core Module. And this is how it might work:
And that's it. I can then script some commands to publish a To improve it even further, each |
@shirhatti - Here's an entire thread of people telling you that app_offline doesn't work, without extensive manual intervention: It seems these two are duplicates, and this is a clone of an older, unsolved issue. I've been getting it repeatedly while trying to update our first 2 services in Azure, so Azure isn't a magical fix either. Can we expect any progress on this? Our company is looking to pivot to microservices right now, and we've got pressures to move to node.js because ".Net Core isn't mature" - issues like this don't help me make my case for preserving our current .Net based workflows. If I'm publishing a .Net Core code, using Microsoft tools (Visual Studio), to a Microsoft platform (Azure) - I shouldn't be facing UX issues like this if you're serious about building a leading-class development platform. These are the kind of issues I expect from Eclipse IDE + Java a decade ago, not Visual Studio and .Net Core in 2019 |
We are about to go to work on some kind of PowerShell work around to get past this problem. Shut down app pool, copy files, start app pool and so forth. There are several such suggestions on similar comment threads about this problem. |
For heavy traffic websites, the dll files are locked for even much longer time despite of using |
Not even heavy traffic, I've been using Blazor Server Side in my own IIS, one user (myself), and using app_offline.htm shows an erratic behaviour... |
If you are deploying with a fresh web.config, adding a "Delete Files" task targeting the current web.config prior to copying forces IIS to stop and releases the lock on the .dlls. If you're not deploying a fresh config you could move the current config to a temp location, copy your release files, then move the config back for the same effect. |
I experience the same issue with Windows 2012 R2 deployments as part of a Jenkins pipeline. It has been working fine for a period and now i'm consistently getting this error. We're using
to no avail |
Still having the same problem... today a file stayed locked for the whole night.... |
We are facing that issue since long time now. We are deploying 30+ environments simultaneously and 70% +/- are failing reliably. We created a powershell script to switch the AppPool to a Stopped Apppool but even that doesn't help and the deployment fails. We have to manually access all the failed systems, a few of them are hosted OnPremise, connecting via vpn / rdp to manually fix that. It is absolutely not acceptable and I expect at least a reliable workaround. |
Why microsoft developers can't resolve that issue? Is it so hard? |
not sure but i hit this issue and i've just added:
to the publish profile and it worked just fine! |
Closing this as dupe of #3793 (mostly because the other one has more discussion). |
Copy of issue #694, because it was closed even though this problem is still unresolved and @Eilon ignores comments that it's still unresolved.
By @pekkah:
The text was updated successfully, but these errors were encountered: