locked
The imported project "Xamarin.iOS.CSharp.targets" was not found error - Visual Studio 7 - Mac RRS feed

  • Question

  • User383458 posted

    I am working on a Xamarin.Forms project with Visual Studio 2017 Professional with Windows machine. Also, I am using a Mac to build and run the iOS app by pairing the Mac with VS 2017. Sometimes Visual Studio on Mac is also used to build and run the app for both iOS and Android platforms of the same project and Macbook had Visual Studio 2017 for Mac.

    Recently I had to restore the Macbook and reinstall the Xamarin development setup. Now the problem is if I install VS 2019 for Mac, it comes with Mono version 6.x.x and my VS 2017 on windows doesn't support that version as it always tells that there's a "Mono version mismatch" and asks to install Mono version 5.18.1, but VS 2019 for Mac does not support that version.

    Then I downloaded VS 2017 for mac from the archive and did a fresh installation. After that, when I tried to pair mac with VS on Windows machine, it again notified the "Mono version mismatch" and installed mono 5.18.1. With that version, even a simple Xamarin.Forms project could not able to build on VS 2017 on Mac as it reports this error:

    Getting restore information for project /Projects/Hello/Hello.iOS/Hello.iOS.csproj /Projects/Hello/Hello.iOS/Hello.iOS.csproj(153,3) : error MSB4019: The imported project "/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/xbuild/Xamarin/iOS/Xamarin.iOS.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. Unable to create package spec for project. /Projects/Hello/Hello.iOS/Hello.iOS.csproj

    Thursday, September 26, 2019 10:11 AM

Answers

  • User369978 posted

    I think it's the best and quickest solution .

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, September 27, 2019 7:05 AM

All replies

  • User369978 posted

    Update VS for mac and VS for windows both to 2019.

    Thursday, September 26, 2019 3:50 PM
  • User383458 posted

    @ColeX is that the only solution?

    Friday, September 27, 2019 5:00 AM
  • User369978 posted

    I think it's the best and quickest solution .

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, September 27, 2019 7:05 AM
  • User383458 posted

    Yes, I agree! Going to try it within the next couple of weeks. But I guess there should be something to do with this other than updating both.

    Friday, September 27, 2019 8:23 AM