Skip to content
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

Allow for disabling default MAUI usings when embedding #19314

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mattleibow
Copy link
Member

@mattleibow mattleibow commented Dec 8, 2023

Description of Change

Provide a way to disable the maui usings when embedding to avoid many ambiguities.

This is mainly for windows, but android does have a few as well.

@mattleibow mattleibow requested a review from a team as a code owner December 8, 2023 22:52
@@ -7,7 +7,7 @@
</MauiXaml>
</ItemDefinitionGroup>

<ItemGroup Condition=" ('$(ImplicitUsings)' == 'true' or '$(ImplicitUsings)' == 'enable') and '$(TargetFrameworkVersion)' != '' ">
<ItemGroup Condition=" ('$(MauiEnablePlatformUsings)' != 'true') and ('$(ImplicitUsings)' == 'true' or '$(ImplicitUsings)' == 'enable') and '$(TargetFrameworkVersion)' != '' ">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also do this in a .csproj today:

<Using Remove="@(Using->HasMetadata('Sdk'))" />

There is an example here how we removed iOS/Android default usings:

Would you also want to restore the default iOS/Android usings?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is using the same property that does restore the platform usings. So if you restore the platform usings, it disables the maui usings as they pretty much all conflict.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, at minimum, it seems like we want a project in here we could build as a test case. Just one that would fail to build if it didn't work correctly, and also is an example of embedding?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am trying my best to get that in, but we got no budget to add samples today. I have one locally, but maybe this all must wait then.

@mattleibow
Copy link
Member Author

This will have to wait for embedding to become a priority.

@samhouts samhouts added the stale Indicates a stale issue/pr and will be closed soon label Jan 8, 2024
@Eilon Eilon added the area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-single-project Splash Screen, Multi-Targeting, MauiFont, MauiImage, MauiAsset, Resizetizer stale Indicates a stale issue/pr and will be closed soon t/native-embedding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants