Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent casing of Configuration msbuild property when ArtifactsPath is set and unset #45026

Open
LiamLeane opened this issue Nov 21, 2024 · 0 comments
Labels
Area-NetSDK untriaged Request triage from a team member

Comments

@LiamLeane
Copy link

Describe the bug

When the ArtifactsPath property is set the Configuration property is converted to lowercase (EG Debug becomes debug in paths)

https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.DefaultOutputPaths.targets#L57
https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.DefaultOutputPaths.targets#L92

When it is unset the same case set in the configuration definition is used (EG Debug remains Debug in paths).

This bit me when I was trying to work around #41530 with a file copy but the inconsistent naming caused issues. I would suggest there should be a singular approach to casing rather than two.

To Reproduce

dotnet build --configuration "Debug"

will produce bin/Debug in project folders

dotnet build --configuration "Debug" --artifacts-path build-output

will produce build-output/bin//debug

Exceptions (if any)

Further technical details

.NET SDK:
 Version:           8.0.110
 Commit:            87a66bb3d1
 Workload version:  8.0.100-manifests.9143487c

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  22.04
 OS Platform: Linux
 RID:         ubuntu.22.04-x64
 Base Path:   /usr/lib/dotnet/sdk/8.0.110/

.NET workloads installed:
 Workload version: 8.0.100-manifests.9143487c
There are no installed workloads to display.

Host:
  Version:      8.0.10
  Architecture: x64
  Commit:       81cabf2857

.NET SDKs installed:
  8.0.110 [/usr/lib/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 8.0.10 [/usr/lib/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 8.0.10 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Workaround for anyone else who runs into this without being able to apply the patch to set artifact path via CLI if you define the property via msbuild (eg in a Directory.build.props)

<PropertyGroup>
    <ArtifactsPath>$(MSBuildThisFileDirectory)\build-output</ArtifactsPath>
  </PropertyGroup>

dotnet restore restores in the right place and uses the lowercase configuration in the path so at least all the commands produce consistent output.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-NetSDK untriaged Request triage from a team member labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant