Search code examples
visual-studioxamarinxamarin.iosvisual-studio-2022

After upgrading Visual Studio 2022 preview My iOS project is no longer loading


After Upgrading Visual Studio 2022 preview my iOS Xamarin projects no longer load and I receive the error messages

C:\<projectName>.iOS.csproj : error : The imported project "C:\Program Files\Microsoft Visual Studio\2022\Preview\MSBuild\Xamarin\iOS\Xamarin.iOS.CSharp.targets" was not found. Also, tried to find "Xamarin\iOS\Xamarin.iOS.CSharp.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Users<user>\AppData\Local\Microsoft\VisualStudio\17.0_211b4038\devenv.exe.config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths. C:\<projectName>.iOS.csproj


Solution

  • With the last update, they seemed to have defaulted the ".NET Multi-platform App UI development" workload to just ".NET MAUI" since it was just released (non-preview).

    To get the iOS projects loading again, in Visual Studio go to "Tools"-> "Get Tools and Features..." Under Installation details, expand ".NET Multi-platform App UI development" under the "Optional" section make sure "Xamarin SDKs" is checked.

    Xamarin SDKs location