Adding macOS to a project created in Windows

amirvenusamirvenus USMember ✭✭✭

Hi,

I just created a new XF Projects targetting iOS, Android, UWP and WPF in Windows and decided to add macOS to it as well.

So I copied the project to a computer running macOS High Sierra and followed the instructions to add macOS to my existing shared project.

While I can still compile and run every other project in the shared project solution (obviously apart from UWP and WPF) on macOS, the macOS one does not build and generates the following error:

/Users/apple/Projects/vanxshop/VanX/VanX/VanX.macOS/VanX.macOS.csproj(11,11): Error MSB4226: The imported project "/Library/Frameworks/Mono.framework/Versions/5.10.1/lib/mono/xbuild/Xamarin/Mac/Xamarin.Mac.CSharp.targets" was not found. Also, tried to find "Xamarin/Mac/Xamarin.Mac.CSharp.targets" in the fallback search path(s) for $(MSBuildExtensionsPath) - "/Library/Frameworks/Mono.framework/External/xbuild/" and "/Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/AddIns/docker/MonoDevelop.Docker/MSbuild" . These search paths are defined in "/Users/apple/Library/Caches/VisualStudio/7.0/MSBuild/45652_1/MonoDevelop.Projects.Formats.MSBuild.exe.config". Confirm that the path in the declaration is correct, and that the file exists on disk in one of the search paths. (MSB4226) (VanX.macOS)

Answers

  • ElvisXiaElvisXia Member, Forum Administrator, Xamarin Team Xamurai

    Hi,
    @amirvenus , I've tried creating a new blank Xamarin.Forms project(Shared Library) with Xamarin.Forms 3.0.0.561731 and copy it to my mac os. Then I followed the steps of this blog and it runs well. Could you please try that?

    Notes: please make sure you are adding the same version of Xamarin.Forms package. Please let me know if the error persists or any other error occurs.

  • amirvenusamirvenus USMember ✭✭✭

    That error was really strange.

    I solved it by updating my VS Mac to a Beta release and magically, everything works now.

Sign In or Register to comment.