Web Deploy - Publish Website (Ms Deploy)

I created a web application with Asp.NET MVC 4 and I’d like to deploy it to Windows azure using Octopus Deploy.
I have imported the “Web Deploy - Publish Website (Ms Deploy)” template and I added it as step in my process deploy.

Below is the error that I have been having when I try deploy it.

GAC Version Location


True v2.0.50727 C:\Windows\assembly\GAC_MSIL\Microsoft.Web.Deployment…
Finding path to package step: DeployNuget
Package was installed to: C:\Octopus\Applications\QA\AhTask.Web\1.0.0.25_3
Info 13:18:13
You cannot call a method on a null-valued expression.
Info 13:18:13
At C:\Windows\system32\config\systemprofile\AppData\Local\Tentacle\Temp\a22354a
Info 13:18:13
6-1603-470b-bf35-e33db1ef1909.ps1:100 char:1
Info 13:18:13

  • $skipPaths = $OctopusParameters[‘SkipSyncPaths’].Split(";",
    Info 13:18:13
    [System.StringSplitO …
    Info 13:18:13

Info 13:18:13

Info    13:18:13
    + CategoryInfo          : InvalidOperation: (:) [], ParentContainsErrorRec 
Info    13:18:13
   ordException
Info    13:18:13
    + FullyQualifiedErrorId : InvokeMethodOnNull
Info    13:18:13
Skipping delete actions on App_Data
Info    13:18:13
==============================================
PowerShell exit code: 1

I appreciate any helps.

Thanks!

Hi,

Thanks for getting in touch! Could you please send us the full raw log so we can take a better look at what is going on during the deployment?

http://docs.octopusdeploy.com/display/OD/Get+the+raw+output+from+a+task

Thanks!

Dalmiro

Hi Dalmiro,

Please find the raw log attached.

Thank you for helping me!

ServerTasks-199.log.txt (12 KB)

Hi,

Last night we released Octopus 3.0.1, where we added support to this kind of Azure deployments right out of the box (and not through a library step template). If your rely a lot in Azure deployments, I’d definitely recommend you to give Octopus 3 a try: http://octopusdeploy.com/blog/octopus-3.0-released

About your current issue: The error seems to be exactly what you sent on the first reply. I needed to be sure that there wasn’t something else around, that’s why I asked for the logs.

Finding path to package step: DeployNuget
Package was installed to: C:\Octopus\Applications\QA\AhTask.Web\1.0.0.25_3
You cannot call a method on a null-valued expression.

I’m gonna need a bit more info about your deployment process

  1. A screenshot of the step “Web Deploy - Publish Website (MSDeploy)” where I can see the values of all the fields. There might be something funny going on in one of these fields that might be caussing that null-valued method call.

  2. I’m gonna need you to enable these debugging variables, then run a new deployment (so the new variables take effect) and send me the raw log

Thanks!

Dalmiro

Hi,

I will definitely check out the new release. However, I would like to understand what I am doing wrong with current version. I am sending you the new Log and Screen of my Web Deploy step.

Thanks,

ServerTasks-259.log.txt (123 KB)

Hi,

Apparently this is caused because the Powershell script of the step is not checking for a Null or empty value for $OctopusParameters[‘SkipSyncPaths’]. I’ve added a check for that on this gist: https://gist.github.com/Dalmirog/f98f3ed17ffa0489bb54

Please try to use that version of the step and let me know how it goes.

Thanks!

Hello,

First of all, thanks for your great product :).

I have an ASP .NET MVC 5 application and I am failing to deploy it using Web Deploy - Publish Website (Ms Deploy)

On my computer, I have

  • Octopus Server and Octopus Tentacle installed
  • WebDeploy 3.6
  • Remote Agent Service and WebManagement Service are up

Remote Server:

  • IIS 7
  • Remote Agent Service and WebManagement Service are up
  • WebDeploy 3.6

I am able to publish via Visual Studio from my computer to the remote server.

With Octopus, I got the following error:

10:58:01 Info | GAC Version Location
10:58:01 Info | — ------- --------
10:58:01 Info | True v2.0.50727 C:\WINDOWS\assembly\GAC_MSIL\Microsoft.Web.Deployment…
10:58:01 Info | Package was installed to: C:\Octopus\Applications\Develop\My_Company_Name.FrontOffice.Web\1.0.0.0_16
10:58:02 Info | Skipping delete actions on App_Data
10:58:02 Info | Publishing Website
10:58:02 Verbose | Exception when calling «SyncTo» with «4» argument(s): «Impossible to
10:58:02 Verbose | connect on remote server (‘recette.My_Company_Name.org’). On the remote
10:58:02 Verbose | server, check that Web Deploy is installed and the required process
10:58:02 Verbose | (‘Web Management Service’) is started. To know more:
10:58:02 Verbose | http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE.»
10:58:02 Verbose | At line C:\Octopus\Work\20160629085759-16\Script.ps1:121 : 1
10:58:02 Verbose | + $changes = $deploymentObject.SyncTo(“contentPath”, $websiteName, $des …
10:58:02 Verbose | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10:58:02 Verbose | + CategoryInfo : NotSpecified: (:slight_smile: [], ParentContainsErrorRecordE
10:58:02 Verbose | xception
10:58:02 Verbose | + FullyQualifiedErrorId : DeploymentDetailedException
10:58:02 Error | The remote script failed with exit code 1

You’ll find the full log enclosed.

Thanks in advance!

ServerTasks-206.log.txt (15 KB)

Hi Barry,

Thanks for reaching out and for the compliments :slight_smile:

May I ask why are you using that MSDeploy step instead of using the built in IIS deploy support in Octopus?

One of the reasons we built MS deploy was to get away from old and faulty deployment methods like MSDeploy and “Publish” (in fact, the phrase “Friends don’t let friends Right click -> Publish” is quite popular in our office). We do provide great support to deploy to machines running IIS: http://docs.octopusdeploy.com/display/OD/IIS+Websites+and+Application+Pools

That step template you are currently using, while it is in our library, was submitted by a member of the community. There’s a strong reason why we don’t provide built-in support to MSDeploy, and its because it simply isn’t a deployment method we recommend.

Any chance I can convince you to start using the built in IIS steps in Octopus instead?

Thanks,
Dalmiro

Hello Dalmiro,

Thanks for your reply.

They used to use MSDeploy to deploy on their servers running on Azure.

If I use the IIS built in deploy, it means that I should install a Octopus Tentacle on the Production Server. Am I right ?

Thanks!

Hi Barry,

That’s correct, you’ll need to Install the Tentacle on the servers. This doc shows how to automate that process: http://docs.octopusdeploy.com/display/OD/Automating+Tentacle+installation

Thanks!
Dalmiro

Hi Dalmiro,

Thanks for your reply. Really appreaciate it :).