microsoft / azure-pipelines-tasks

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

[REGRESSION]: VSBuild .NET 9 Configuration Not Found #20688

Closed stevenrlp closed 1 week ago

stevenrlp commented 1 week ago

New issue checklist

Task name

VSBuild@1

Breaking task version

1

Last working task version

1

Regression Description

Upgraded my application to .NET 9 and attempted to run the same pipeline I have been using for some time and now it fails with the error:

[error]D:\a\1\s\source\Web\Frontend\node_modules\lmdb\dependencies\lz4\lib\dll\example\fullbench-dll.sln.metaproj(0,0): Error MSB4126: The specified solution configuration "Release|Any CPU" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration.

I have attempted the following command lines with no success:

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'
    - 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: VSBuild@1
      inputs:
        solution: '$(solution)'
        msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=false /p:PackageLocation="$(build.artifactStagingDirectory)" /p:Configuration="$(buildConfiguration)" /p:Platform="$(buildPlatform)"'

My .sln file contain the following global configuration:

Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Release|Any CPU = Release|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {E73DEC73-6251-4981-BB9B-D50896B80955}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {E73DEC73-6251-4981-BB9B-D50896B80955}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {E73DEC73-6251-4981-BB9B-D50896B80955}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {E73DEC73-6251-4981-BB9B-D50896B80955}.Release|Any CPU.Build.0 = Release|Any CPU
        {10FB2153-D624-4971-A25D-A7ECC5D84DCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {10FB2153-D624-4971-A25D-A7ECC5D84DCD}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {10FB2153-D624-4971-A25D-A7ECC5D84DCD}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {10FB2153-D624-4971-A25D-A7ECC5D84DCD}.Release|Any CPU.Build.0 = Release|Any CPU
        {2CB1DC0F-7144-4707-8168-D19961C1814B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {2CB1DC0F-7144-4707-8168-D19961C1814B}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {2CB1DC0F-7144-4707-8168-D19961C1814B}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {2CB1DC0F-7144-4707-8168-D19961C1814B}.Release|Any CPU.Build.0 = Release|Any CPU
        {FEE1A75A-095E-44F6-B4A5-CA066F0338D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {FEE1A75A-095E-44F6-B4A5-CA066F0338D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {FEE1A75A-095E-44F6-B4A5-CA066F0338D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {FEE1A75A-095E-44F6-B4A5-CA066F0338D6}.Release|Any CPU.Build.0 = Release|Any CPU
        {9C097830-8BE9-4417-866B-CB9078CDD95E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {9C097830-8BE9-4417-866B-CB9078CDD95E}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {9C097830-8BE9-4417-866B-CB9078CDD95E}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {9C097830-8BE9-4417-866B-CB9078CDD95E}.Release|Any CPU.Build.0 = Release|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
    GlobalSection(ExtensibilityGlobals) = postSolution
        SolutionGuid = {A6271FF1-0DFA-4557-9E90-16FD5A74237F}
    EndGlobalSection
EndGlobal

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

Windows

Relevant log output

"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\msbuild.exe" "D:\a\1\s\source\Web\Frontend\node_modules\lmdb\dependencies\lz4\lib\dll\example\fullbench-dll.sln" /nologo /nr:false /dl:CentralLogger,"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.248.0\node_modules\azure-pipelines-tasks-msbuildhelpers\tools\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll";"RootDetailId=14cedb10-f0e1-4a00-ad41-eab12d6a471b|SolutionDir=D:\a\1\s\source\Web\Frontend\node_modules\lmdb\dependencies\lz4\lib\dll\example|enableOrphanedProjectsLogs=true"*ForwardingLogger,"D:\a\_tasks\VSBuild_71a9a2d3-a98a-4caa-96ab-affca411ecda\1.248.0\node_modules\azure-pipelines-tasks-msbuildhelpers\tools\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll" /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=false /p:PackageLocation="D:\a\1\a" /p:Configuration="Release" /p:Platform="Any CPU" /p:VisualStudioVersion="17.0" /p:_MSDeployUserAgent="VSTS_791c3af1-d369-4350-b14a-7a04218ebc93_build_15_0"
Build started 11/24/2024 11:06:48 AM.

##[error]D:\a\1\s\source\Web\Frontend\node_modules\lmdb\dependencies\lz4\lib\dll\example\fullbench-dll.sln.metaproj(0,0): Error MSB4126: The specified solution configuration "Release|Any CPU" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration.
Project "D:\a\1\s\source\Web\Frontend\node_modules\lmdb\dependencies\lz4\lib\dll\example\fullbench-dll.sln" on node 1 (default targets).
D:\a\1\s\source\Web\Frontend\node_modules\lmdb\dependencies\lz4\lib\dll\example\fullbench-dll.sln.metaproj : error MSB4126: The specified solution configuration "Release|Any CPU" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [D:\a\1\s\source\Web\Frontend\node_modules\lmdb\dependencies\lz4\lib\dll\example\fullbench-dll.sln]
Done Building Project "D:\a\1\s\source\Web\Frontend\node_modules\lmdb\dependencies\lz4\lib\dll\example\fullbench-dll.sln" (default targets) -- FAILED.

Build FAILED.

"D:\a\1\s\source\Web\Frontend\node_modules\lmdb\dependencies\lz4\lib\dll\example\fullbench-dll.sln" (default target) (1) ->
(ValidateSolutionConfiguration target) -> 
  D:\a\1\s\source\Web\Frontend\node_modules\lmdb\dependencies\lz4\lib\dll\example\fullbench-dll.sln.metaproj : error MSB4126: The specified solution configuration "Release|Any CPU" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [D:\a\1\s\source\Web\Frontend\node_modules\lmdb\dependencies\lz4\lib\dll\example\fullbench-dll.sln]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.09
##[error]Process 'msbuild.exe' exited with code '1'.
1
Finishing: VSBuild

Full task logs with system.debug enabled

UNSUCCESSFUL RUN
 [REPLACE THIS WITH YOUR INFORMATION] 
SUCCESSFUL RUN
 [REPLACE THIS WITH YOUR INFORMATION] 

Repro steps

stevenrlp commented 1 week ago

Sorry I think I worked it out, there is another .sln file in the files that got added during the upgrade I guess and I assume it is picking this up and complaining about the configuration. Only now when I posted this I noticed the start of the error message references a sln file in the node_modules folder.