{"id":15421702,"url":"https://github.com/pedrolamas/msbuildconfigurationdefaults","last_synced_at":"2025-04-14T15:36:33.316Z","repository":{"id":145486286,"uuid":"88992640","full_name":"pedrolamas/MSBuildConfigurationDefaults","owner":"pedrolamas","description":"MSBuild build configuration helper for new project format","archived":false,"fork":false,"pushed_at":"2017-06-06T13:27:31.000Z","size":13,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T04:30:43.550Z","etag":null,"topics":["csproj-tooling","msbuild","netcore"],"latest_commit_sha":null,"homepage":"https://pedrolamas.github.io/MSBuildConfigurationDefaults/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pedrolamas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"pedrolamas","patreon":"pedrolamas","ko_fi":"pedrolamas","custom":"https://paypal.me/pedrolamas"}},"created_at":"2017-04-21T14:32:11.000Z","updated_at":"2023-09-12T19:33:12.000Z","dependencies_parsed_at":"2023-06-02T11:46:39.036Z","dependency_job_id":null,"html_url":"https://github.com/pedrolamas/MSBuildConfigurationDefaults","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"2660fa31d4825187fc2a9a2c48d9ff4fb589b31b"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrolamas%2FMSBuildConfigurationDefaults","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrolamas%2FMSBuildConfigurationDefaults/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrolamas%2FMSBuildConfigurationDefaults/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrolamas%2FMSBuildConfigurationDefaults/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedrolamas","download_url":"https://codeload.github.com/pedrolamas/MSBuildConfigurationDefaults/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248907160,"owners_count":21181291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csproj-tooling","msbuild","netcore"],"created_at":"2024-10-01T17:35:36.941Z","updated_at":"2025-04-14T15:36:33.295Z","avatar_url":"https://github.com/pedrolamas.png","language":null,"funding_links":["https://github.com/sponsors/pedrolamas","https://patreon.com/pedrolamas","https://ko-fi.com/pedrolamas","https://paypal.me/pedrolamas"],"categories":[],"sub_categories":[],"readme":"# MSBuild Configuration Defaults [![Build status](https://ci.appveyor.com/api/projects/status/b04pij25k0dbfll9?svg=true)](https://ci.appveyor.com/project/PedroLamas/msbuildconfigurationdefaults \"Build Status\") [![Latest stable version](https://img.shields.io/nuget/v/MSBuildConfigurationDefaults.svg?style=flat)](https://www.nuget.org/packages/MSBuildConfigurationDefaults/ \"Latest stable version\")\n\nMSBuild based projects have two default build configurations: Debug and Release.\n\nWhile these two configurations are enough for most projects, some might actually require custom build configurations that will support different environments, alternative build targets, etc..\n\nUntil now we could use Visual Studio Configuration Manager to easily create a copy an existing configuration setup, and then change small bits to match our specifications.\n\nBut now there's a [new csproj format for .NET Core](https://docs.microsoft.com/en-us/dotnet/articles/core/tools/csproj), and while it includes the expected Debug and Release build configurations, the \"copy configuration\" process doesn't work anymore!\n\nThe problem is that the new project format is based in quite a few implicit defaults, so Visual Studio Configuration Manager can't actually create a copy of the existing build configurations with all the properties set.\n\nIdeally, one would like to \"inherit\" from the base Debug and Release configurations, and then just override specific properties.\n\nThis is where the `MSBuildConfigurationDefaults` NuGet package comes in!\n\n## Installation\n\nInstall the NuGet package by running the following command:\n\n```\nInstall-Package MSBuildConfigurationDefaults\n```\n\nAfter this step, closing and re-opening the solution is recommended to ensure the build scripts changes are correctly loaded.\n\n## Usage\n\nOnce installed, any build configuration with name starting or ending on \"Debug\" will have the following build properties set by default:\n\n```xml\n\u003cDefineConstants\u003e$(DefineConstants);DEBUG;TRACE\u003c/DefineConstants\u003e\n\u003cDebugSymbols\u003etrue\u003c/DebugSymbols\u003e\n\u003cDebugType\u003efull\u003c/DebugType\u003e\n\u003cOptimize\u003efalse\u003c/Optimize\u003e\n```\n\nSimilarly, any build configuration with name starting or ending on \"Release\" will have the following build properties set by default:\n\n```xml\n\u003cDefineConstants\u003e$(DefineConstants);RELEASE;TRACE\u003c/DefineConstants\u003e\n\u003cDebugSymbols\u003efalse\u003c/DebugSymbols\u003e\n\u003cDebugType\u003eportable\u003c/DebugType\u003e\n\u003cOptimize\u003etrue\u003c/Optimize\u003e\n```\n\nIf any of these properties are set on the project, those values will have override the defaults above.\n\nIf you don't want to name your custom build definition according to the rules above, just add a `ConfigurationGroup` property and set the value to `Debug` or `Release` to ensure those build definitions get the appropriate default properties set.\n\n## Examples\n\nThe following is an example of a custom build configuration called \"Production\", that has the default values set as for the \"Release\" build configuration, but also overrides the `DebugSymbols` property default value:\n\n```xml\n\u003cPropertyGroup Condition=\"'$(Configuration)' == 'Production'\"\u003e\n  \u003cConfigurationGroup\u003eRelease\u003c/ConfigurationGroup\u003e\n  \u003cDebugSymbols\u003etrue\u003c/DebugSymbols\u003e\n\u003c/PropertyGroup\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrolamas%2Fmsbuildconfigurationdefaults","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedrolamas%2Fmsbuildconfigurationdefaults","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrolamas%2Fmsbuildconfigurationdefaults/lists"}