0

I'm trying to configure a release pipeline for deploying my asp.net framework 4.5.2 web app to virtual machine. here's my pipeline .yml file:

# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4

trigger:
- master

pool:
  vmImage: 'windows-latest'

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  inputs:
    restoreSolution: '$(solution)'

- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

- task: VSTest@2
  inputs:
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

- task: PublishBuildArtifacts@1

problem is that release gets successfully executed but i don't see any changes in my website. when i started to google i figured out that many were facing this problem because of cache issues (recommendations: use incognito mode, cleare cache etc.) but then i took a look at release logs and saw that deploy goes to Default Web Site folder in wwwroot/inetpub, but my site is already hosted on IIS and got different location. so i guess i should change the destination path. can anyone help me with that? Thanks in advance.

mmd744
  • 49
  • 9

1 Answers1

1
  1. I noticed you specified /p:PackageLocation="$(build.artifactStagingDirectory), you need to double check whether the package has in build.artifactStagingDirectory. I didn't see you had a task that copied the artifact to that location.

  2. Check whether you can use IIS Web App Deployment Using WinRM to deploy your web app.

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • I found it very useful to add a debugging script step while setting up pipelines and include calls to `echo` various environment variables or even show the content of a directory like so: `tree $(build.artifactStagingDirectory)\1 /f` – user1007074 Apr 20 '23 at 12:51