简体   繁体   中英

System.AggregateException: Azure can't deploy website

So i have been deploying my website for some days now, suddenly i get a weird error when i try to deploy my website. I do use GIT, so maybe something went wrong there. These errors are kinda hard for me to understand. So i hope someone here can help me.

When i deploy the website, this is the error visual studio returns:

Web deployment task failed. (Web Deploy cannot modify the file 'PraktijkOpdracht.dll' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. Learn more at:http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE .)

And when i look into the temp file where the error get logged. I see this:

15-12-17 22:58:28 System.AggregateException: One or more errors occurred. ---> System.Exception: Publish failed due to build errors. Check the error list for more details. --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at Microsoft.VisualStudio.Web.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass40_0.b__2() at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.ApplicationCapabilities.Publish.ViewModel.ProfileSelectorViewModel.d__108.MoveNext() ---> (Inner Exception #0) System.Exception: Publish failed due to build errors. Check the error list for more details.<---

I've experienced this before as well. I restarted my Web App and was then able to publish. This seemed to be a transient error for us.

The key to it is "it is locked by an external process." This kind of error usually can happen when the serviceplan is small dimensioned.

At that time more than one deployment is trying to succeed - before the other could finish.

Best practice to resolve could be :

  • extend the serviceplan
  • ensure to use deployment slots(make use of parallel deploy stages)

I faced the same issue and got resolved after selected the checkbox in settings (I selected Publish to Folder)

    1. Delete all existing files prior to publish
    1. Precompile during publishing
    1. Exclude files from the App_Data folder

Thanks

Minimize the path of publish folder with project name

Ex:

E:\\ABC Project\\bin\\Release\\PublishOutput

Then publish the project.

I've experienced the same in both publishing to Azure and local IIS path in my devenv

it was in Visual Studio publishing Settings > File Publish Options and uncheck Precompile during publishing checkbox

I know this was posted quite awhile ago, but I experienced this same issue and for me the problem was trying to publish my website to a folder that required administrative rights. Moving to a folder that didn't require administrative rights fixed this for me. Maybe running VS in administrator mode would also help, but I haven't tested that yet. Hopefully this helps someone at some point.

My case may be rare but FWIW I had this error/problem and it was due to a recent change to my network password. I was using VPN and Visual Studio was publishing to \\server\\c$... and until I disconnected from that c$ share and reconnected w/my new credentials I kept getting this VS publish error.

Same issue.

Cause was a middle application causing certificate to fail validation, in my case it was 'Fiddler'.

Troubleshooting: in VS web project -> Publish window -> click the edit pencil and then the Connection menu item on the left -> Click the Validate Connection button --->>> this will show a 'DO_NOT_TRUST_FiddlerRoot' error when the Fiddler application is in capturing mode (make sure to click "Reject" here); turn off capturing mode and click the Validate Connection to see this is the issue.

I have not looked into pulling the debug cert off VS and adding it to the Fiddler app but manual seems to work fine for the work I am doing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM