How do I use Azure DevOps pipeline to build an ASP NET web site

0 votes

I am working with an older code and attempting to build an ASP.NET website (no .csproj files). I've created a pipeline for ASP.NET added some tasks to my .yml:

# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://docs.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: PublishPipelineArtifact@1
  inputs:
    targetPath: '$(Pipeline.Workspace)'
    artifact: 'drop'
    publishLocation: 'pipeline'

However, when I run the pipeline, it fails on the VSBuild task: VSBuildResults

I think the problem is in line 18 where the -p ..\BOMViewer\ is specifying a directory that doesn't exist.

Do I need to follow DJ Grossman's solution later: Can Azure DevOps Pipelines build an ASP.NET Web Site?

How to specify -p \BOMViewer instead of the above?

I changed solution to .publishproj from .sln in my YAML . But VSBuild doesn't like the change: enter image description here

Mar 23 in Other DevOps Questions by Kichu
• 16,050 points
88 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Other DevOps Questions

0 votes
0 answers
0 votes
0 answers
0 votes
1 answer
0 votes
0 answers
0 votes
0 answers
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP