-
Notifications
You must be signed in to change notification settings - Fork 655
Deploying ASP.NET Core 2.1 application from repo fails #2788
Comments
It has happened multiple times, I managed to redeploy with site restart. |
I logged in remotely via Kudu and found out that it's not running .NET Core 2.1. How did you get it to recognize 2.1?
|
@1digicoder: Your log appears to be from Azure App Service on Linux. Unrelated to this issue. There doesn't seem to be a 2.1 runtime container for App Service on Linux yet. You can either build your own container, wait until the official is published or use App Service on Windows. |
@hajekj correct, Linux works differently. Let's limit this issue to the Windows side so we don't end up confusing ourselves :) |
@hajekj - Noticed the difference, and thanks for the extra info, was able to get past my blocker. |
I can make another application deploy which is likely to fail and keep it that way for few days if you would like me to. |
I tried with my dummy2.1core app and consecutive deployments seems to work Yes, it will be helpful to investigate a case, another question I have is if you change your project to 2.0 does it solve the issue? |
Well I just tried pushing again and it seems to work now... Could it be because I previously had remote debugging enabled which I then disabled? |
very likely...since the pdb is used by remote debugging. Although I am not sure what's the expected user experience for that case, I may need your complete workflow |
So my workflow:
I just tried but I couldn't reproduce the issue again... I swear this happened to me like 3-4 times. Maybe was just bad luck. |
I've hit this issue multiple times with different web sites running on different app service plans running on Windows. Currently I have to restart the web app and then do a redeploy to make the deployment succeed. I can't remember having any issues before I updated my web apps to .NET Core 2.0.0 |
I'm not debugging and remote debugging is switched off. I do deployments from git - almost every single time I push, it errors out telling me the file (xxxx.Views.pdb) is in use. Restart app, redeploy works every time, but it's annoying. I found out if I push two changes within a short timespan then there is no lock on the pdb file and the deployment works as expected. Just pushed a got the error message:
|
This feels more like a dotnet runtime issue than a Kudu issue. Kudu just does deployment, and if there is a file that is hopelessly locked by the Core runtime, there is little that Kudu can do to deploy over it. So it's best to switch the focus on that angle, and try to figure out why the runtime is locking your PDBs if you're not debugging. It may be best to report that in a .NET Core forum or repo. |
I just hit the same issue today again. I restarted the site and it started to work. Then, I made some more changes (not critical) and it failed again. I can see that the pdb is once again being used. I left the app in the failed state so if you want to try to do any sort of debugging, feel free. |
I don't think the code throws any exception. I will double check soon. Still, shouldn't there be some automatic mechanism to "unlock" all files when redeploying? |
@hajekj one thing that could be interesting to experiment with is to use a custom deployment script that creates an |
I will give that a try. So is it enough to create |
@hajekj Kudu knows nothing about this file. It's the Core Runtime that detects it and takes itself offline. You may need to add a one second wait after creating the file. Tip: you can create an empty file by just calling |
I will try it shortly and report back. |
I am having the same issue, I am getting "Failed to change file that is currently being used" and it is pointing to a PDB file that is the same as my webApp.dll file. Its a web app, core 2.1, deployed from BitBucket. |
@CampsiteHelper what is causing the PDB to be loaded? Were you remote debugging the app? When I test with a default 2.1 MVC app, I can't repro. My specific steps:
And everything works. Are you able to repro the issue with those steps? If not, it would be interesting to try isolating what is different with your app that is causing the PDB to get locked. |
@davidebbo Nothing that I am aware of. I believe the cause is actually that the app is not given enough time to shut down (this is the out of the box deployment script..) as when I shut the app down, the deploy works fine. |
We upgraded recently to 2.2 and we are still getting multiple errors of |
Hi If the problem persists and is related to running it on Azure App Service, please open a support incident in Azure: This way we can better track and assist you on this case Thanks, Joaquin Vano |
Repro steps.
When deploying ASP.NET Core 2.1 application to Azure App Service from VSTS using CI in App Service, the deployment fails.
Project structures.
The application doesn't have any specific structure and is basically built with the default scaffolding.
The log/error given by the failure.
Debug your Azure website remotely.
The affected site's name is
captive365.azurewebsites.net
Mention any other details that might be useful.
This doesn't seem to happen on other sites I have deployed which are running ASP.NET Core 2.0.
The text was updated successfully, but these errors were encountered: