microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.5k stars 2.61k forks source link

[BUG]: dotnet build fails with CS7034 on ubuntu when setting Version property with prerelease label included #18478

Closed SWarnberg closed 11 months ago

SWarnberg commented 1 year ago

Task name

DotNetCoreCLI@2

Task version

2.221.0

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

ubuntu-22.04

Task log

2023-06-12T07:43:49.8227833Z ##[section]Starting: Build projects
2023-06-12T07:43:49.8233850Z ==============================================================================
2023-06-12T07:43:49.8233960Z Task         : .NET Core
2023-06-12T07:43:49.8234009Z Description  : Build, test, package, or publish a dotnet application, or run a custom dotnet command
2023-06-12T07:43:49.8234121Z Version      : 2.221.0
2023-06-12T07:43:49.8234169Z Author       : Microsoft Corporation
2023-06-12T07:43:49.8234227Z Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
2023-06-12T07:43:49.8234317Z ==============================================================================
2023-06-12T07:43:50.1226001Z Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version.
2023-06-12T07:43:50.1349150Z [command]/opt/hostedtoolcache/dotnet/dotnet build /home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/BookKeeping.Contracts.csproj -dl:CentralLogger,"/home/vsts/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.221.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"/home/vsts/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.221.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" -c Release -p:Version=1.0.8-preview.5
2023-06-12T07:43:50.6972482Z MSBuild version 17.3.2+561848881 for .NET
2023-06-12T07:43:51.4935278Z   Determining projects to restore...
2023-06-12T07:43:52.1777382Z   Restored /home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/BookKeeping.Contracts.csproj (in 146 ms).
2023-06-12T07:43:53.6742316Z ##[warning]BookKeeping/BookKeeping.Contracts/obj/Release/net6.0/BookKeeping.Contracts.AssemblyInfo.cs(16,59): Warning CS7035: The specified version string does not conform to the recommended format - major.minor.build.revision
2023-06-12T07:43:53.6781972Z /home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/obj/Release/net6.0/BookKeeping.Contracts.AssemblyInfo.cs(16,59): warning CS7035: The specified version string does not conform to the recommended format - major.minor.build.revision [/home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/BookKeeping.Contracts.csproj]
2023-06-12T07:43:53.6791556Z ##[error]BookKeeping/BookKeeping.Contracts/obj/Release/net6.0/BookKeeping.Contracts.AssemblyInfo.cs(20,55): Error CS7034: The specified version string does not conform to the required format - major[.minor[.build[.revision]]]
2023-06-12T07:43:53.6795152Z /home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/obj/Release/net6.0/BookKeeping.Contracts.AssemblyInfo.cs(20,55): error CS7034: The specified version string does not conform to the required format - major[.minor[.build[.revision]]] [/home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/BookKeeping.Contracts.csproj]
2023-06-12T07:43:53.6867940Z 
2023-06-12T07:43:53.6871201Z Build FAILED.
2023-06-12T07:43:53.6881350Z 
2023-06-12T07:43:53.6882166Z /home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/obj/Release/net6.0/BookKeeping.Contracts.AssemblyInfo.cs(16,59): warning CS7035: The specified version string does not conform to the recommended format - major.minor.build.revision [/home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/BookKeeping.Contracts.csproj]
2023-06-12T07:43:53.6882961Z /home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/obj/Release/net6.0/BookKeeping.Contracts.AssemblyInfo.cs(20,55): error CS7034: The specified version string does not conform to the required format - major[.minor[.build[.revision]]] [/home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/BookKeeping.Contracts.csproj]
2023-06-12T07:43:53.6883249Z     1 Warning(s)
2023-06-12T07:43:53.6883359Z     1 Error(s)
2023-06-12T07:43:53.6891044Z 
2023-06-12T07:43:53.6896870Z Time Elapsed 00:00:02.87
2023-06-12T07:43:53.7105037Z ##[error]Error: The process '/opt/hostedtoolcache/dotnet/dotnet' failed with exit code 1

Relevant log output

##[debug]which '/opt/hostedtoolcache/dotnet/dotnet'
##[debug]found: '/opt/hostedtoolcache/dotnet/dotnet'
##[debug]/opt/hostedtoolcache/dotnet/dotnet arg: build
##[debug]/opt/hostedtoolcache/dotnet/dotnet arg: /home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/BookKeeping.Contracts.csproj
##[debug]/opt/hostedtoolcache/dotnet/dotnet arg: -dl:CentralLogger,"/home/vsts/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.221.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"/home/vsts/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.221.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"
##[debug]/opt/hostedtoolcache/dotnet/dotnet arg: -c Release -p:Version="1.0.8-preview.6"
##[debug]exec tool: /opt/hostedtoolcache/dotnet/dotnet
##[debug]arguments:
##[debug]   build
##[debug]   /home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/BookKeeping.Contracts.csproj
##[debug]   -dl:CentralLogger,"/home/vsts/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.221.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"/home/vsts/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.221.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"
##[debug]   -c
##[debug]   Release
##[debug]   -p:Version=1.0.8-preview.6
/opt/hostedtoolcache/dotnet/dotnet build /home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/BookKeeping.Contracts.csproj -dl:CentralLogger,"/home/vsts/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.221.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"/home/vsts/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.221.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" -c Release -p:Version=1.0.8-preview.6
MSBuild version 17.3.2+561848881 for .NET
  Determining projects to restore...
  Restored /home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/BookKeeping.Contracts.csproj (in 125 ms).
##[debug]Processed: ##vso[task.logdetail id=a9facb57-a6ce-443b-89f2-31dc0b6a6ffc;parentid=;name=BookKeeping.Contracts.AssemblyInfo.cs;type=Build;starttime=2023-06-12T08:13:25.2154504Z;state=InProgress;]
##[warning]BookKeeping/BookKeeping.Contracts/obj/Release/net6.0/BookKeeping.Contracts.AssemblyInfo.cs(16,59): Warning CS7035: The specified version string does not conform to the recommended format - major.minor.build.revision
##[debug]Processed: ##vso[task.logissue type=Warning;sourcepath=/home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/obj/Release/net6.0/BookKeeping.Contracts.AssemblyInfo.cs;linenumber=16;columnnumber=59;code=CS7035;]The specified version string does not conform to the recommended format - major.minor.build.revision
##[debug]Processed: ##vso[task.logdetail id=a9facb57-a6ce-443b-89f2-31dc0b6a6ffc;parentid=;type=Build;result=Failed;finishtime=2023-06-12T08:13:25.2198050Z;progress=100;state=Completed;parentid=;name=;]
/home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/obj/Release/net6.0/BookKeeping.Contracts.AssemblyInfo.cs(16,59): warning CS7035: The specified version string does not conform to the recommended format - major.minor.build.revision [/home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/BookKeeping.Contracts.csproj]
##[error]BookKeeping/BookKeeping.Contracts/obj/Release/net6.0/BookKeeping.Contracts.AssemblyInfo.cs(20,55): Error CS7034: The specified version string does not conform to the required format - major[.minor[.build[.revision]]]
##[debug]Processed: ##vso[task.logissue type=Error;sourcepath=/home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/obj/Release/net6.0/BookKeeping.Contracts.AssemblyInfo.cs;linenumber=20;columnnumber=55;code=CS7034;]The specified version string does not conform to the required format - major[.minor[.build[.revision]]]
/home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/obj/Release/net6.0/BookKeeping.Contracts.AssemblyInfo.cs(20,55): error CS7034: The specified version string does not conform to the required format - major[.minor[.build[.revision]]] [/home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/BookKeeping.Contracts.csproj]

Build FAILED.

/home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/obj/Release/net6.0/BookKeeping.Contracts.AssemblyInfo.cs(16,59): warning CS7035: The specified version string does not conform to the recommended format - major.minor.build.revision [/home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/BookKeeping.Contracts.csproj]
/home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/obj/Release/net6.0/BookKeeping.Contracts.AssemblyInfo.cs(20,55): error CS7034: The specified version string does not conform to the required format - major[.minor[.build[.revision]]] [/home/vsts/work/1/s/BookKeeping/BookKeeping.Contracts/BookKeeping.Contracts.csproj]
    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.66
##[debug]Exit code 1 received from tool '/opt/hostedtoolcache/dotnet/dotnet'
##[debug]STDIO streams have closed for tool '/opt/hostedtoolcache/dotnet/dotnet'
##[error]Error: The process '/opt/hostedtoolcache/dotnet/dotnet' failed with exit code 1
##[debug]Processed: ##vso[task.issue type=error;]Error: The process '/opt/hostedtoolcache/dotnet/dotnet' failed with exit code 1

Aditional info

As can be seen, the projects are being built with the command 'dotnet build -c Release -p:Version=1.0.8-preview.5'.

This works perfectly on local Windows as well as WSL Ubuntu 22.04 environments, but it fails in DevOps pipelines.
github-actions[bot] commented 11 months ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days