2

I have an ASP.Net Core web application (DotNetCore.1.0.1 VS2015Tools.Preview2.0.2) which I'm trying to publish to an Azure App Service via Visual Studio.

The Azure App Service and Resource Group are both completely new.

The publish process fails after several minutes on 'Executing command ["C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe"'. The 'web publish activity' log in Visual Studio says "Retrying the sync because a socket error (10054) occurred. Retrying operation 'Serialization' on object sitemanifest (sourcePath) Attempt 1 of 100." There are many more errors 100 but that is the first one.

I've had this problem a LOT with ASP.Net core and never really resolved it as it just seems to work occasionally.

Can anyone shed any light?

My Publish.ps1 is as follows

[cmdletbinding(SupportsShouldProcess=$true)]
param($publishProperties=@{}, $packOutput, $pubProfilePath)

# to learn more about this file visit https://go.microsoft.com/fwlink/?LinkId=524327

try{
    if ($publishProperties['ProjectGuid'] -eq $null){
        $publishProperties['ProjectGuid'] = '28343c8d-220f-435e-9b48-bf90a3b9068d'
    }

    $publishModulePath = Join-Path (Split-Path $MyInvocation.MyCommand.Path) 'publish-module.psm1'
    Import-Module $publishModulePath -DisableNameChecking -Force

    # call Publish-AspNet to perform the publish operation
    Publish-AspNet -publishProperties $publishProperties -packOutput $packOutput -pubProfilePath $pubProfilePath
}
catch{
    "An error occurred during publish.`n{0}" -f $_.Exception.Message | Write-Error
}
Martin Kearn
  • 2,313
  • 1
  • 21
  • 35
  • I have actually never encountered it.. how are you publishing - git? visual studio? – gilmishal Sep 27 '16 at 10:39
  • also, does it only happen with asp.net core app? – gilmishal Sep 27 '16 at 10:39
  • I'm publishing via the 'Publish' button in Visual Studio (right-click project > publish > choose your app service etc). Yes only ASP.Net core apps – Martin Kearn Sep 27 '16 at 10:40
  • I am guessing running it with IIS Express locally works? – gilmishal Sep 27 '16 at 10:41
  • can you show your publish.ps1? – gilmishal Sep 27 '16 at 10:43
  • Yes local IIS works fine. I've just created a new set of Azure resources (group, app service etc) and getting the same problem. The code is in this repo: https://github.com/martinkearn/How-Happy – Martin Kearn Sep 27 '16 at 10:43
  • and the pubxml file – gilmishal Sep 27 '16 at 10:45
  • have you tried using a different connection? you should look here http://stackoverflow.com/questions/29696898/vs-to-azure-publish-failure-socket-error-10054 – gilmishal Sep 27 '16 at 10:49
  • I'll see if i can try a different connection. Interestingly, I just tried a deployment direct form GitHub and the web app says "The service is unavailable." http://howhappycouk.azurewebsites.net/ – Martin Kearn Sep 27 '16 at 11:07
  • 1
    The reason it says that is that the site got left with an `App_Offline.htm` probably because a deployment failed halfway through. You can delete it using [Kudu Console](https://github.com/projectkudu/kudu/wiki/Kudu-console). It's in `D:\home\site\wwwroot`. – David Ebbo Sep 27 '16 at 19:56

0 Answers0