Microsoft.Maui version 8.0.70 NuGet packages automatically switch back to 8.0.61

Kim Strasser 1,036 Reputation points
2024-07-23T20:52:20.9+00:00

I have updated the NuGet packages Microsoft.Maui.Controls, Microsoft.Maui.Controls.Compatibility and Microsoft.Maui.Essentials from version 8.0.61 to 8.0.70. Then I got the following error when I tried to build my iOS project:

Error MSB4019 The imported project "C:\Program Files\dotnet\packs\Aspire.Hosting.Sdk\8.0.2\Sdk\AutoImport.props" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\packs\Aspire.Hosting.Sdk\8.0.2\Sdk\AutoImport.props" is correct, and that the file exists on disk. IOSTest C:\Program Files\dotnet\sdk\8.0.303\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.props

Why am I getting this error?

Then I removed my project´s bin and obj folder and opened it again in Visual Studio Community 2022 (64-bit) Version 17.10.4. Then I saw that the NuGet packages automatically switched from version 8.0.61 to 8.0.70.

Why can I not use version 8.0.70 in my iOS project?

Screenshot 2024-07-23 224934

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,189 questions
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,588 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 66,621 Reputation points
    2024-07-24T18:04:50.28+00:00

    nuget package references are stored in the project file. you probably did not save the project file after updating the packages. so when reopened it was reverted. you should save all after updating packages. you should also delete the bin & object folders before doing a restore/build.

    I suspect your dotnet workloads need updating or are corrupt. The Maui and Aspire workloads are often problematic:

    https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-workload

    0 comments No comments

Your answer

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