I have a legacy project and want to get into Azure Devops pipelines. I have a build pipeline setup and build seems to succeed. I've added a DotnetcoreCli Publish task and this succeeds but I never have any artifacts available after running so can't implement a Release pipeline.
Wondering if anyone can spot anything daft I've done?
These are the Tasks defined in my pipeline:
- task: DotNetCoreCLI@2 inputs: command: 'build' projects: '$(solution)' arguments: '--configuration $(buildConfiguration)' displayName: 'dotnet build $(buildConfiguration)' - task: DotNetCoreCLI@2 condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/UAT')) inputs: command: 'publish' publishWebProjects: true configuration: $(BuildConfiguration) arguments: '--output $(Build.ArtifactStagingDirectory) --verbosity detailed' zipAfterPublish: false # We want individual files published, not a zip
This is the end of the trace of my Publish task:
(entry point): 2021-09-09T08:57:26.4983992Z Task "Message" 2021-09-09T08:57:26.4984515Z MYOrg.MyApp.UI -> D:\a\1\a\Staging\MYOrg.MyApp.UI\ 2021-09-09T08:57:26.4985051Z
Done executing task "Message". 2021-09-09T08:57:26.4985655Z
1>Done building target "Publish" in project "MYOrg.MyApp.UI.csproj". 2021-09-09T08:57:26.4986271Z Target "_InitProjectCapabilityProperties" skipped. Previously built successfully. 2021-09-09T08:57:26.4991632Z 1>Target "_InitPublishIntermediateOutputPath" in file "C:\hostedtoolcache\windows\dotnet\sdk\2.0.3\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\DotNetCLIToolTargets\Microsoft.NET.Sdk.DotNetCLITool.targets" from project "D:\a\1\s\MYOrg.MyApp.UI\MYOrg.MyApp.UI.csproj" (target "_AspNetCoreProjectSystemPostPublish" depends on it): 2021-09-09T08:57:26.4992847Z Task "ConvertToAbsolutePath" 2021-09-09T08:57:26.4993300Z Done executing task "ConvertToAbsolutePath". 2021-09-09T08:57:26.4993889Z 1>Done building target "_InitPublishIntermediateOutputPath" in project "MYOrg.MyApp.UI.csproj". 2021-09-09T08:57:26.4994986Z 1>Target "_TransformWebConfig" in file "C:\hostedtoolcache\windows\dotnet\sdk\2.0.3\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\TransformTargets\Microsoft.NET.Sdk.Publish.TransformFiles.targets" from project "D:\a\1\s\MYOrg.MyApp.UI\MYOrg.MyApp.UI.csproj" (target "_AspNetCoreProjectSystemPostPublish" depends on it): 2021-09-09T08:57:26.4996207Z Using "TransformWebConfig" task from assembly "C:\hostedtoolcache\windows\dotnet\sdk\2.0.3\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0....\tools\netcoreapp1.0\Microsoft.NET.Sdk.Publish.Tasks.dll". 2021-09-09T08:57:26.4997005Z Task "TransformWebConfig" 2021-09-09T08:57:26.5010124Z Configuring the following project for use with IIS: 'D:\a\1\a\Staging\MYOrg.MyApp.UI' 2021-09-09T08:57:26.5010856Z Updating web.config at 'D:\a\1\a\Staging\MYOrg.MyApp.UI\web.config' 2021-09-09T08:57:26.5129541Z Configuring project completed successfully 2021-09-09T08:57:26.5140303Z Done executing task "TransformWebConfig". 2021-09-09T08:57:26.5143720Z 1>Done building target "_TransformWebConfig" in project "MYOrg.MyApp.UI.csproj". 2021-09-09T08:57:26.5145086Z 1>Target "_TransformAppSettings" in file "C:\hostedtoolcache\windows\dotnet\sdk\2.0.3\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\TransformTargets\Microsoft.NET.Sdk.Publish.TransformFiles.targets" from project "D:\a\1\s\MYOrg.MyApp.UI\MYOrg.MyApp.UI.csproj" (target "_AspNetCoreProjectSystemPostPublish" depends on it): 2021-09-09T08:57:26.5146333Z Task "TransformAppSettings" skipped, due to false condition; ('$(_IsAspNetCoreProject)' == 'true' And '$(IsTransformAppSettingsDisabled)' != 'true' And @(DestinationConnectionStrings) != '') was evaluated as ('true' == 'true' And '' != 'true' And != ''). 2021-09-09T08:57:26.5153800Z
1>Done building target "_TransformAppSettings" in project "MYOrg.MyApp.UI.csproj". 2021-09-09T08:57:26.5156303Z 1>Target "_GenerateEFSQLScripts" in file "C:\hostedtoolcache\windows\dotnet\sdk\2.0.3\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\TransformTargets\Microsoft.NET.Sdk.Publish.TransformFiles.targets" from project "D:\a\1\s\MYOrg.MyApp.UI\MYOrg.MyApp.UI.csproj" (target "_AspNetCoreProjectSystemPostPublish" depends on it): 2021-09-09T08:57:26.5157868Z Task "GenerateEFSQLScripts" skipped, due to false condition; ('$(_IsAspNetCoreProject)' == 'true' And '$(IsGenerateEFSQLScriptsDisabled)' != 'true' And @(EfMigrations) != '') was evaluated as ('true' == 'true' And '' != 'true' And != ''). 2021-09-09T08:57:26.5180482Z 1>Done building target "_GenerateEFSQLScripts" in project "MYOrg.MyApp.UI.csproj". 2021-09-09T08:57:26.5183010Z 1>Target "_GenerateRunCommandFile" in file "C:\hostedtoolcache\windows\dotnet\sdk\2.0.3\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\TransformTargets\Microsoft.NET.Sdk.Publish.TransformFiles.targets" from project "D:\a\1\s\MYOrg.MyApp.UI\MYOrg.MyApp.UI.csproj" (target "_AspNetCoreProjectSystemPostPublish" depends on it): 2021-09-09T08:57:26.5185028Z Task "GenerateRunCommandFile" skipped, due to false condition; ('$(_IsWebJobProject)' == 'true' And '$(IsGenerateRunCommandFileDisabled)' != 'true') was evaluated as ('' == 'true' And '' != 'true'). 2021-09-09T08:57:26.5185862Z 1>Done building target "_GenerateRunCommandFile" in project "MYOrg.MyApp.UI.csproj". 2021-09-09T08:57:26.5186601Z Target "_PublishFiles" skipped, due to false condition; ('$(PublishProtocol)' != 'FileSystem' And '$(PublishProtocol)' != '') was evaluated as ('FileSystem' != 'FileSystem' And 'FileSystem' != ''). 2021-09-09T08:57:26.5187820Z 1>Target "_AspNetCoreProjectSystemPostPublish" in file "C:\hostedtoolcache\windows\dotnet\sdk\2.0.3\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\DotNetCLIToolTargets\Microsoft.NET.Sdk.DotNetCLITool.targets" from project "D:\a\1\s\MYOrg.MyApp.UI\MYOrg.MyApp.UI.csproj" (target "_DotNetCLIPostPublish" depends on it): 2021-09-09T08:57:26.5188885Z
1>Done building target "_AspNetCoreProjectSystemPostPublish" in project "MYOrg.MyApp.UI.csproj". 2021-09-09T08:57:26.5189885Z
1>Target "AfterPublish" in file "C:\hostedtoolcache\windows\dotnet\sdk\2.0.3\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\Microsoft.NET.Sdk.Publish.targets" from project "D:\a\1\s\MYOrg.MyApp.UI\MYOrg.MyApp.UI.csproj" (target "_DotNetCLIPostPublish" depends on it): 2021-09-09T08:57:26.5190833Z
1>Done building target "AfterPublish" in project "MYOrg.MyApp.UI.csproj". 2021-09-09T08:57:26.5191798Z 1>Target "_DotNetCLIPostPublish" in file "C:\hostedtoolcache\windows\dotnet\sdk\2.0.3\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\DotNetCLIToolTargets\Microsoft.NET.Sdk.DotNetCLITool.targets" from project "D:\a\1\s\MYOrg.MyApp.UI\MYOrg.MyApp.UI.csproj" (entry point): 2021-09-09T08:57:26.5192771Z 1>Done building target "_DotNetCLIPostPublish" in project "MYOrg.MyApp.UI.csproj". 2021-09-09T08:57:26.5193415Z 1>Done Building Project "D:\a\1\s\MYOrg.MyApp.UI\MYOrg.MyApp.UI.csproj" (Publish target(s)). 2021-09-09T08:57:26.5210238Z 2021-09-09T08:57:26.5225190Z Build succeeded. 2021-09-09T08:57:26.5260048Z 0 Warning(s) 2021-09-09T08:57:26.5260950Z 0 Error(s)
After dontet publish command you need to make Azure Pipeline artifact.
You can do this in this way:
- publish: $(Build.ArtifactStagingDirectory)
artifact: WebApp
Here you have documentation about this. After that, you will get an artifact available for release pipeline.