Fix iOS Custom Entitlements File Not Respected in Single Project Templates#30275
Merged
PureWeen merged 3 commits intoinflight/currentfrom Aug 4, 2025
Merged
Fix iOS Custom Entitlements File Not Respected in Single Project Templates#30275PureWeen merged 3 commits intoinflight/currentfrom
PureWeen merged 3 commits intoinflight/currentfrom
Conversation
…d CodesignEntitlements Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] iOS Custom Entitlements File Not Respected
Fix iOS Custom Entitlements File Not Respected in Single Project Templates
Jun 27, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses an issue where MAUI was unconditionally overriding the CodesignEntitlements property and not respecting custom user settings for iOS and MacCatalyst.
- Updated the condition for setting CodesignEntitlements in both iOS and MacCatalyst targets to only set the property when it is not already defined.
- This change maintains backward compatibility and prevents build errors related to entitlement mismatches.
Member
|
/azp run MAUI-public |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
|
Can you added test ? |
- Added SingleProject_CodesignEntitlementsRespected test to verify custom CodesignEntitlements property is preserved - Added SingleProject_DefaultEntitlementsUsedWhenNoCustomSet test to verify default behavior still works - Tests validate the fix for issue #30221 where custom entitlements were being overridden Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
Contributor
Author
I've added comprehensive MSBuild tests for the CodesignEntitlements fix in commit 44c19ff. The tests verify both scenarios:
Both tests pass and validate the fix for issue #30221. |
|
Azure Pipelines successfully started running 1 pipeline(s). |
rolfbjarne
approved these changes
Jul 2, 2025
github-actions bot
pushed a commit
that referenced
this pull request
Aug 7, 2025
…lates (#30275) * Initial plan * Fix iOS Custom Entitlements File override issue - respect user-defined CodesignEntitlements Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> * Add MSBuild tests for CodesignEntitlements fix - Added SingleProject_CodesignEntitlementsRespected test to verify custom CodesignEntitlements property is preserved - Added SingleProject_DefaultEntitlementsUsedWhenNoCustomSet test to verify default behavior still works - Tests validate the fix for issue #30221 where custom entitlements were being overridden Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
PureWeen
pushed a commit
that referenced
this pull request
Aug 8, 2025
…lates (#30275) * Initial plan * Fix iOS Custom Entitlements File override issue - respect user-defined CodesignEntitlements Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> * Add MSBuild tests for CodesignEntitlements fix - Added SingleProject_CodesignEntitlementsRespected test to verify custom CodesignEntitlements property is preserved - Added SingleProject_DefaultEntitlementsUsedWhenNoCustomSet test to verify default behavior still works - Tests validate the fix for issue #30221 where custom entitlements were being overridden Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
github-actions bot
pushed a commit
that referenced
this pull request
Aug 11, 2025
…lates (#30275) * Initial plan * Fix iOS Custom Entitlements File override issue - respect user-defined CodesignEntitlements Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> * Add MSBuild tests for CodesignEntitlements fix - Added SingleProject_CodesignEntitlementsRespected test to verify custom CodesignEntitlements property is preserved - Added SingleProject_DefaultEntitlementsUsedWhenNoCustomSet test to verify default behavior still works - Tests validate the fix for issue #30221 where custom entitlements were being overridden Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
github-actions bot
pushed a commit
that referenced
this pull request
Aug 15, 2025
…lates (#30275) * Initial plan * Fix iOS Custom Entitlements File override issue - respect user-defined CodesignEntitlements Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> * Add MSBuild tests for CodesignEntitlements fix - Added SingleProject_CodesignEntitlementsRespected test to verify custom CodesignEntitlements property is preserved - Added SingleProject_DefaultEntitlementsUsedWhenNoCustomSet test to verify default behavior still works - Tests validate the fix for issue #30221 where custom entitlements were being overridden Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
github-actions bot
pushed a commit
that referenced
this pull request
Aug 15, 2025
…lates (#30275) * Initial plan * Fix iOS Custom Entitlements File override issue - respect user-defined CodesignEntitlements Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> * Add MSBuild tests for CodesignEntitlements fix - Added SingleProject_CodesignEntitlementsRespected test to verify custom CodesignEntitlements property is preserved - Added SingleProject_DefaultEntitlementsUsedWhenNoCustomSet test to verify default behavior still works - Tests validate the fix for issue #30221 where custom entitlements were being overridden Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
github-actions bot
pushed a commit
that referenced
this pull request
Aug 19, 2025
…lates (#30275) * Initial plan * Fix iOS Custom Entitlements File override issue - respect user-defined CodesignEntitlements Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> * Add MSBuild tests for CodesignEntitlements fix - Added SingleProject_CodesignEntitlementsRespected test to verify custom CodesignEntitlements property is preserved - Added SingleProject_DefaultEntitlementsUsedWhenNoCustomSet test to verify default behavior still works - Tests validate the fix for issue #30221 where custom entitlements were being overridden Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
github-actions bot
pushed a commit
that referenced
this pull request
Aug 22, 2025
…lates (#30275) * Initial plan * Fix iOS Custom Entitlements File override issue - respect user-defined CodesignEntitlements Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> * Add MSBuild tests for CodesignEntitlements fix - Added SingleProject_CodesignEntitlementsRespected test to verify custom CodesignEntitlements property is preserved - Added SingleProject_DefaultEntitlementsUsedWhenNoCustomSet test to verify default behavior still works - Tests validate the fix for issue #30221 where custom entitlements were being overridden Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com> Co-authored-by: rmarinho <1235097+rmarinho@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Description
This PR fixes an issue where MAUI unconditionally overrides the
CodesignEntitlementsproperty when a defaultEntitlements.plistfile exists, ignoring any custom entitlements file specified by the developer.Problem
When developers set a custom entitlements file via the
CodesignEntitlementsproperty in their project file, MAUI's build targets would ignore this setting and always usePlatforms\iOS\Entitlements.plistorPlatforms\MacCatalyst\Entitlements.plistif those files exist. This causes build errors when the default entitlements don't match the provisioning profile requirements.For example, a developer might configure:
But MAUI would still use
Platforms\iOS\Entitlements.plist, leading to errors like:Root Cause
In
Microsoft.Maui.Controls.SingleProject.Before.targets, lines 47 and 53 unconditionally set theCodesignEntitlementsproperty:This overwrites any user-defined value, even when the developer has explicitly set a custom entitlements file.
Solution
Added a condition to check if
CodesignEntitlementsis already set before applying the default value:This change:
CodesignEntitlementsproperty valuesTesting
Validated the fix with targeted MSBuild tests that verify:
CodesignEntitlementsproperty is preserved when set by the userEntitlements.plistis still used when no custom property is setFixes #30221.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.