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

Transition away from implicit package references #14770

Merged
merged 25 commits into from
Apr 27, 2023
Merged

Conversation

mattleibow
Copy link
Member

@mattleibow mattleibow commented Apr 25, 2023

Description of Change

This PR checks and then adds a warning if it finds that the developer does not have a package reference to .NET MAUI in the project file. Implicit package references cause issues with the Package Manager UI as well as the CLI.

Not only do with fix some issues, developers can now have better control over the packages included and the transitive dependencies.

The project templates now have an additional package:

<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />

We are keeping the variable so that developers can choose to allow the IDE to update the version of .NET MAUI being used. This can be replaced with an explicit version, but then will no longer receive updates when the IDE is updated.

This PR replaces #14576

Future Work

@mattleibow mattleibow requested a review from a team as a code owner April 25, 2023 18:25
@Eilon Eilon added the area-setup Installation, setup, requirements, maui-check, workloads, platform support label Apr 26, 2023
FileUtilities.ReplaceInFile(projectFile,
"</Project>",
"<PropertyGroup><Version>1.0.0-preview.1</Version></PropertyGroup></Project>");

string target = shouldPack ? "Pack" : "";
Copy link
Member

Choose a reason for hiding this comment

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

no your change, but string.Empty should have been used.

('@(_MauiImplicitRequiredPackageReference->Count())' != '0') ">

<PropertyGroup>
<_MauiValidateRefsPrefix>Starting with .NET 8, setting </_MauiValidateRefsPrefix>
Copy link
Member Author

Choose a reason for hiding this comment

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

These messages... @rmarinho what is the way to localize?

Copy link
Member

Choose a reason for hiding this comment

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

Use resources? how do you pull into here I think I saw something about that

Copy link
Member

Choose a reason for hiding this comment

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

@mcumming @pjcollins do you know?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

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 created an issue for the localization part: #14804

I found a few plain text strings that we need to localize across our targets.

@mkArtakMSFT
Copy link
Member

Looks fine to me but I'd like @MackinnonBuck or @Eilon to review this too just in case there are things beyond my knowledge that can cause trouble down the road (specifically around Blazor).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-setup Installation, setup, requirements, maui-check, workloads, platform support fixed-in-8.0.0-preview.4.8333 Look for this fix in 8.0.0-preview.4.8333!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants