My project has multiple frameworks
net6.0;net7.0;net8.0
I created a YAML file and everything works, but when I set it to .NET 8, meaning a single framework.
trigger:
- main
pool:
vmImage: ‘windows-latest’
variables:
buildConfiguration: ‘Release’
steps:
-
script: echo ‘Starting the build’
displayName: ‘Starting Build’ -
script: dotnet restore
displayName: ‘Restore Dependencies’ -
script: dotnet build –configuration $(buildConfiguration) –no-restore
displayName: ‘Build Project’ -
task: DotNetCoreCLI@2
inputs:
command: ‘publish’
publishWebProjects: true
arguments: ‘–configuration $(buildConfiguration) –output $(Build.ArtifactStagingDirectory) -property:TargetFramework=net8.0’
zipAfterPublish: false
displayName: ‘Publish Artifact’ -
task: PublishPipelineArtifact@1
inputs:
targetPath: ‘$(Build.ArtifactStagingDirectory)’
artifact: ‘myAppBuild’
publishLocation: ‘pipeline’
displayName: ‘Publish Build Artifact’
I need a solution that supports .NET 6, .NET 7, and .NET8
Adnan Hodzic is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.