Update maui-mobile template: Sets the msbuild property _KeepLaunchProfiles to true and adds the MauiSingleProject project capability #527
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.
Description of Change
To enable the switch between target frameworks on VisualStudio the LaunchProfiles capability need to be enabled.
By default, it is enabled but this capability is removed by our SDKs because the HEAD projects (Android and iOS) does not use this IDE feature to display devices on the start button.
The _KeepLaunchProfiles property avoids that removal in order to have LaunchProfiles enabled on VisualStudio.
The MauiSingleProject project capability is required to identify single projects and when VisualStudio loads a project with this capability the initialization required for Android and iOS is executed, starting the services for both platforms.
The Android and iOS project capabilities cannot be used to do that because only one set of these capabilities (related to the current TargetFramework) is available at this moment.
These values need to be available when the project is loaded and if we set them on the targets for the MAUI NuGet package the first time after creating the project there are not recognized because we need a Nuget restore.