Forum Xamarin.iOS

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

tharindu_mptharindu_mp Member ✭✭
edited September 2019 in Xamarin.iOS

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

Best Answer


  • ColeXColeX Member, Xamarin Team Xamurai

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

  • tharindu_mptharindu_mp Member ✭✭

    @ColeX is that the only solution?

  • tharindu_mptharindu_mp Member ✭✭

    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.

Sign In or Register to comment.