How to migrate from Xamarin at Maui a dependency in NUGET

Paolo Mossa 246 Reputation points
2026-07-19T15:41:37.4033333+00:00

Hi to all.

I'va translated a Xamarin project into MAUI environement. The error gived by the compiler is the follower:

...

Code="MA001"

	Text="This project or a dependency has imported the Xamarin.Forms packages. .NET MAUI is not compatible with Xamarin.Forms and is unable to build. Please remove Xamarin.Forms or the project/package dependency that is using Xamarin.Forms."

	Condition="'$(_XFTargetsImported)' == 'true'"/>

</Target>

My problem consists in the fact that the NUGET package Xamarin.Forms is visible in the NUGETs packages but it is impossible to disinstall (the button Install is present but not Disinstall).

In the code is no more present the string "XAmarin.Forms".

Thanks in advance for any suggestion

Developer technologies | .NET | .NET Multi-platform App UI

4 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 84,671 Reputation points
    2026-07-19T19:06:18.99+00:00

    Probably you are using a nuget package that depends on Xarmin forms. List dependencies to find the package(s) you must replace:

    dotnet list package --include-transitive
    

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments

  2. Nancy Vo (WICLOUD CORPORATION) 7,825 Reputation points Microsoft External Staff Moderator
    2026-07-20T04:07:56.3233333+00:00

    Hello @Paolo Mossa ,

    Thanks for your question.

    If the Uninstall option is unavailable for Xamarin.Forms, consider examining the dependency tree to see whether the package is being brought in through another NuGet package.

    You can refer to these following steps:

    1. In Visual Studio, go to Solution Explorer > Dependencies > Packages.
    2. Expand your installed packages to look at their sub-dependencies. Find the older package that has Xamarin.Forms listed inside it.
    3. Go to the NuGet Package Manager and uninstall that older package.
    4. Install a new, .NET MAUI-compatible version of that package, or find an alternative library. 5. Close Visual Studio, manually delete your bin and obj folders in File Explorer, and rebuild the project.

    I hope this addresses your question. If this response was helpful, please consider following the guidance to provide feedback. Thank you.

    Was this answer helpful?

    1 person found this answer helpful.

  3. Paolo Mossa 246 Reputation points
    2026-07-19T21:04:25.8733333+00:00

    OK I've found from IA the methods to see the dependencies.

    Thanks for the suggestion.Infact the IA didn't give me a possibility to undestand then pronblem

    Was this answer helpful?

    0 comments No comments

  4. Paolo Mossa 246 Reputation points
    2026-07-19T20:16:05.77+00:00

    Thnx for the answer. I ask to you where I must lauch your statement in order to know the packages that contain the Xamarin.Forms. Can you give me an example?

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.