I’m making a MAUI Android app and some time ago I updated the target framework to .NET8. Since then, I’m getting this warning about Microsoft.Maui.Controls
not being automatically included.
Warning MA002 Starting with .NET 8, setting true
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
in your project file. NLTerminal C:Program
FilesdotnetpacksMicrosoft.Maui.Sdk8.0.7SdkBundledVersions.targets 85
I updated the package to 8.0.21 and then manually added a PackageReference in the .csproj
file:
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.21" />
I then saw, VS automatically also added an Update
reference:
<PackageReference Update="Microsoft.Maui.Controls" Version="8.0.21" />
Is there any way to resolve this warning except suppressing it as it suggests?
<SkipValidateMauiImplicitPackageReferences>true</SkipValidateMauiImplicitPackageReferences>
I figured out the warning is coming from the BundledVersions.targets
file where it seems to be hard-coded to be permanently displayed until it’s erased from there. Is that the right solution though?
Or is there a way to fetch a newer version of Microsoft.Maui.Sdk and hope that will resolve the warning?