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

warning MA002 is raised claiming that packages are not automatically included, yet packages *are* automatically included - leading to making it impossible to add a direct reference to an implicit package through tooling #20658

Open
nkolev92 opened this issue Feb 16, 2024 · 2 comments
Labels
area-setup Installation, setup, requirements, maui-check, workloads, platform support platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 t/bug Something isn't working
Milestone

Comments

@nkolev92
Copy link

Description

The maui templates raise warnings about packages not being included automatically, yet those exact packages are included automatically.

This behavior means that it is impossible to add a direct reference to an implicit package through tooling, because as far as the tooling is concerned, the package is already added in an imported file.

Steps to Reproduce

D:\Maui216> dotnet --version
8.0.300-preview.24101.10

  1. dotnet new maui
  2. dotnet remove package Microsoft.Maui.Controls.Compatibility
  3. dotnet remove package Microsoft.Maui.Controls
  4. dotnet restore
  5. dotnet list package

Observe that at step 4, a warning is raised:

warning MA002: Starting with .NET 8, setting true</UseM
aui> does not automatically include NuGet package references in your project. Update your project by including this item: . You can skip this warning by setting true</SkipValidateMauiImplicitP
ackageReferences> in your project file. [D:\Maui216\Maui216.csproj::TargetFramework=net8.0-android]

However, note that the package is still implicitly added.

Link to public reproduction project repository

No response

Version with bug

Unknown/Other

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

D:\Maui216> dotnet restore
  Determining projects to restore...
C:\Program Files\dotnet\packs\Microsoft.Maui.Sdk\8.0.6\Sdk\BundledVersions.targets(85,5): warning MA002: Starting with .NET 8, setting  <UseMaui>true</UseMaui>  does not automatically include NuGet package re
ferences in your project.  Update your project by including this item:  <PackageReference Include="Microsoft.Maui.Controls" Version="8.0.6" />.  You can skip this warning by setting  <SkipValidateMauiImplicit
PackageReferences>true</SkipValidateMauiImplicitPackageReferences>  in your project file. [D:\Maui216\Maui216.csproj::TargetFramework=net8.0-android]
C:\Program Files\dotnet\packs\Microsoft.Maui.Sdk\8.0.6\Sdk\BundledVersions.targets(85,5): warning MA002: Starting with .NET 8, setting  <UseMaui>true</UseMaui>  does not automatically include NuGet package re
ferences in your project.  Update your project by including this item:  <PackageReference Include="Microsoft.Maui.Controls" Version="8.0.6" />.  You can skip this warning by setting  <SkipValidateMauiImplicit
PackageReferences>true</SkipValidateMauiImplicitPackageReferences>  in your project file. [D:\Maui216\Maui216.csproj::TargetFramework=net8.0-ios]
C:\Program Files\dotnet\packs\Microsoft.Maui.Sdk\8.0.6\Sdk\BundledVersions.targets(85,5): warning MA002: Starting with .NET 8, setting  <UseMaui>true</UseMaui>  does not automatically include NuGet package re
ferences in your project.  Update your project by including this item:  <PackageReference Include="Microsoft.Maui.Controls" Version="8.0.6" />.  You can skip this warning by setting  <SkipValidateMauiImplicit
PackageReferences>true</SkipValidateMauiImplicitPackageReferences>  in your project file. [D:\Maui216\Maui216.csproj::TargetFramework=net8.0-maccatalyst]
C:\Program Files\dotnet\packs\Microsoft.Maui.Sdk\8.0.6\Sdk\BundledVersions.targets(85,5): warning MA002: Starting with .NET 8, setting  <UseMaui>true</UseMaui>  does not automatically include NuGet package re
ferences in your project.  Update your project by including this item:  <PackageReference Include="Microsoft.Maui.Controls" Version="8.0.6" />.  You can skip this warning by setting  <SkipValidateMauiImplicit
PackageReferences>true</SkipValidateMauiImplicitPackageReferences>  in your project file. [D:\Maui216\Maui216.csproj::TargetFramework=net8.0-windows10.0.19041.0]
  All projects are up-to-date for restore.

D:\Maui216> dotnet list package
Project 'Maui216' has the following package references
   [net8.0-android34.0]:
   Top-level Package                               Requested   Resolved
   > Microsoft.Extensions.Logging.Debug            8.0.0       8.0.0
   > Microsoft.Maui.Controls                       8.0.6       8.0.6
   > Microsoft.Maui.Controls.Compatibility         8.0.6       8.0.6
   > Microsoft.NET.ILLink.Tasks              (A)   [8.0.1, )   8.0.1
@nkolev92 nkolev92 added the t/bug Something isn't working label Feb 16, 2024
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Feb 19, 2024
@ghost
Copy link

ghost commented Feb 19, 2024

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@Redth
Copy link
Member

Redth commented Feb 19, 2024

@mattleibow It seems the messaging text is misleading here, and we should correct it.

@PureWeen PureWeen added the area-setup Installation, setup, requirements, maui-check, workloads, platform support label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-setup Installation, setup, requirements, maui-check, workloads, platform support platform/android 🤖 platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants