-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Better support for non-standard $(Configuration)
names
#31918
Comments
@rolfbjarne is there anything you'd like to add here? |
We've documented the properties for iOS that depend on the configuration here: https://github.com/xamarin/xamarin-macios/blob/main/docs/configuration-properties.md One point is what's the difference beteween "release" and "publish": would "dotnet build /p:Configuration=Release" be the same as "dotnet publish"? Or would we need a third option (say Otherwise I agree with everything in the description :) |
There is a new https://learn.microsoft.com/dotnet/core/project-sdk/msbuild-props#publishrelease So anything changed here, should keep this property in mind. |
Another idea could be to let the user tell us their intentions. So we could have a And maybe a By default we'd do something like: <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<BuildIntention Condition=" '$(BuildIntention)' == '' ">Debug</BuildIntention>
</PropertyGroup>
<PropertyGroup Condition=" '$(BuildIntention)' == 'Debug' ">
<DebugSymbols Condition=" '$(DebugSymbols)' == '' ">true</DebugSymbols>
<Optimize Condition=" '$(Optimize)' == '' ">false</Optimize>
</PropertyGroup> |
@rolfbjarne I like your idea, but I would stay with just a single property, say |
This is intented to solve the following problem: for macOS (and Mac Catalyst), publishing to the App Store involves using a signing configuration that produces an app that won't run locally, and publishing outside of the App Store involves a signing configuration that produces an app that can't be published to the App Store. People get this wrong all the time (Apple didn't make signing particularly easy to be honest), but if we knew the developer's intentions, we could create better defaults, and show warnings/errors if the developer does something we know won't work. Right now our defaults are wrong half the time... |
Any updates on this? We have a MAUI project with 14 debug profiles and 14 release profiles to build all of our apps. Among other issues, hot reload isn't working. Thanks |
@mtanml We have a similar scope on our configurations and also struggle with the hot reload bit the most. We tried to manually set all the android/ios defaults for our debug/release equivalent but it will still not work. |
So, I would assume you have various MSBuild logic that has conditions on However, I'm with you; it would be nice if the .NET SDK had support for this. |
Is your feature request related to a problem? Please describe.
.NET MAUI customers commonly create customer project configuration names, such as
ReleaseProd
,AdHoc
,AppStore
, etc.Visual Studio gives a handy UI for creating configurations and setting properties based on them, and so customers use this to toggle values in their applications such as:
$(DefineConstants)
and#if
together.The problem becomes once a custom configuration is made, customers have to somehow know lots of MSBuild properties to set. Starting with:
sdk/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.props
Lines 46 to 54 in 7d23e9d
At minimum, they would need to know to set
$(DebugSymbol)
and$(Optimize)
appropriately.Then for mobile, they would also need:
$(UseInterpreter)
set totrue
for Hot Reload$(EmbedAssembliesIntoApk)
set tofalse
for Android "fast deployment" / sideloading$(PublishTrimmed)
$(RunAOTCompilation)
$(AndroidPackageFormat)
set toaab
to create Android "app bundles" for Google Play instead of an.apk
$(PublishTrimmed)
$(DebuggerSupport)
are off forRelease
modeThere may be several more iOS properties I've left out here.
Describe the solution you'd like
A simple approach would be introduction of new properties like
$(IsDebug)
and$(IsRelease)
where the new code would instead do:Customer projects would do:
And then any defaults defined in optional workloads, etc. are based on these new properties instead of the configuration name directly.
An alternative would be some new MSBuild feature to "inherit" or "extend" configurations. That may just be too much for solving this problem.
Links
The text was updated successfully, but these errors were encountered: