dotnet / dotnet/sdk

Use Configuration.StartsWith('Debug') instead of Configuration == 'Debug' for Debug specific build settings

Open
#44,920 4 comments 5 reactions 1 assignee Claimed by @baronfel View on GitHub
Area-NetSDK untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Description

I use Azure pipelines to build the core and platform-specific libraries for my Maui application. I use build configurations to control which projects are built on each Azure-hosted build agent (Windows, MacOS, Linux). For example, I use "Debug-MacOS" as a build configuration for projects that can be built on the MacOS build host. Similarly, I use Debug-Windows to indicate projects that can only be built on the Windows build agent. I have analogous build configurations for release. In Visual Studio on Windows, I have the option of building the configuration "Debug-Windows" or just "Debug" which includes all projects.

My feature requests are two-fold:
1) Document all build settings that are tied to "Debug" or "Release" configurations. Every release, I spend hours trying to figure out things like AOTCompile, Trimming, release-only optimizations and debug-only configuration settings.
2) Instead of using Configuration == 'Debug', use Configuration.StartsWith('Debug'). Similarly, for Release configurations. This allows the developer to have they own configurations that behave like Debug or Release without having to hardcode 'Debug' or 'Release'. I could have a build configuration like 'Debug-Simulator' that would automatically reflect MAUI's view of debug settings.

### Public API Changes

* Change all references to Configuration == 'Debug' to Configuration.StartsWith('Debug')
* Change all references to Configuration == 'Release' to Configuration.StartsWith('Release')
* Update the developer documents to reflect these changes.

### Intended Use-Case

Support for build configurations outside of "Debug" and "Release"

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.