You should publish your asp net core app instead.
Here's a sample build filefrom one of our projects. This is for asp.net core only. For angular apps we do some extra stuff like run npm install in a different task, but the principle is the same.
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
runtime: 'win-x64'
steps:
- task: NuGetToolInstaller@1
# Restore all nuget packages and .net core tools
- task: DotNetCoreCLI@2
inputs:
command: 'custom'
projects: '**/*.csproj'
custom: 'restore'
arguments: '-r $(runtime)'
# Build projects
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: '**/*.csproj'
arguments: '-c $(BuildConfiguration) --no-restore -r $(runtime)'
# Publish all projects to /staging/ci-build/<ProjectName>/
- task: DotNetCoreCLI@2
inputs:
command: 'publish'
publishWebProjects: false
projects: |
**/*Client.csproj
**/*WorkerService.csproj
**/*Server.csproj
arguments: '-c $(BuildConfiguration) -o $(Build.StagingDirectory)/ci-build --no-build --self-contained -r $(runtime)'
zipAfterPublish: false
# Archive the /staging/ci-build folder to /staging/RemoteData.<BuildNumber>
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.StagingDirectory)/ci-build'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/RemoteData.$(Build.BuildNumber).zip'
replaceExistingArchive: true
# Publish the zipfile as artifact
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/RemoteData.$(Build.BuildNumber).zip'
ArtifactName: 'RemoteData.$(Build.BuildNumber)'
publishLocation: 'Container'