Error when building with Visual Studio for Mac Preview 4

I am getting the following error whem buiding...
/Volumes/MacBook Pro Backup 1/Xamarin/NSE/iOS/NSE.iOS.csproj(3,3): Error MSB4019: The imported project "/Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/xbuild/Xamarin/iOS/Xamarin.iOS.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. (MSB4019) (NSE.iOS)

The path mentioned in the error does not exist. The is no Xamarin directory under xbuild.

This worked fine before upgrading to Preview 4. I even uninstalled Visual Studio and the Mono Framework and reinstalled it.

I assume it is complaining about the following line in my NSE.iOS.csproj file...
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />

Best Answer


  • rothierothie DEMember ✭✭

    Same problem here. Same project works fine in Xamarin Studio and worked also fine before upgrading to Preview 4...

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai


    I just tried to reproduce this issue but could not. A template iOS project built fine and I have that same line in my .csproj file.

    However searching for "Xamarin.iOS.CSharp.targets" on my file system shows that it is in:


    So it would seem that "$(MSBuildExtensionsPath)" MSBuild property is different on your end than mine. But when I look at a diagnostic build output, I do see:

    MSBuildExtensionsPath          = /Library/Frameworks/Mono.framework/Versions/4.8.0/lib/mono/xbuild

    So this might be a missing symlink? I might suggest re-installing the current stable build of Xamarin.iOS:

  • DonMesserli.1843DonMesserli.1843 USMember ✭✭


    Reinstalling Xamarin.iOS didn't solve the problem.

  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai


    OK, sorry that did not work. It would be good to see if this is an environment issue or some issue in the project. Are you getting the same issue even on a new from template iOS project? Like @rothie, does the project build in Xamarin Studio latest stable?

  • iguarnaiguarna ARMember

    Same problem here but there was no need to reinstall Xamarin.iOS. Just closing the solution and opening it back again solved the issue. It keeps happening from time to time and just closing and reopening solves it.

    The error is actually not found while building the project but while cleaning before building.

  • DonMesserli.1843DonMesserli.1843 USMember ✭✭
    Accepted Answer

    Updating to Visual Studio Preview 5 (7.0 Build 1659) fixed the problem.

  • NinineaNininea USUniversity ✭✭✭

    I have the same problem , using visual studio preview 8 ( 7.0 build 2845)

  • stevericheysteverichey USMember ✭✭

    I am having this problem in VS for Mac Community 7.1 (build 1297).

  • stevericheysteverichey USMember ✭✭

    I was able to resolve this particular error by symlinking the missing file (and the files denoted as missing after that) but now I get

    Error MSB3644: The reference assemblies for framework "Xamarin.iOS,Version=v1.0" were not found.

  • PeppelorumPeppelorum USMember

    Download Xamarin iOS and install manually, that solved my problem at least.

Sign In or Register to comment.