Using Shared Library In Xamarin Visual Studio For Mac

Once you have installed Visual Studio for Mac, open it and run the emulator for Android. On the Mac Open a Terminal on your Mac and enter this to add the Android platform tools into the path.

Xamarin visual studio for mac
Active1 year, 7 months ago

I have created a solution in Xamarin (Visual Studio for Mac) that has:

The odd thing is that if I open MyGame.Droid or MyGame.IOS there is a references folder where, for example, the MyGame project is referenced.

But, when I open up MyGame there is no References folder.

How do I add a reference in MyGame to MyLibrary?

Brian RiceBrian Rice
1,4011 gold badge20 silver badges36 bronze badges

Using Shared Library In Xamarin Visual Studio For Mac

1 Answer

Add the new project reference MyLibrary to both MyGame.Droid and MyGame.IOS projects.

It seems you've created a Xamarin.Forms project and then created a .NET Standard library project. By default Xamarin.Forms create a Shared project which means it is shared between MyGame.Droid and MyGame.IOS and whenever you build the Droid it becomes to be a part of the droid project and opposite for the iOS project.

As an alternative, you can convert your Shared project to the .NET Standard and then you will be able to add required references.

VisualAlexey StrakhAlexey Strakh
4,90412 gold badges64 silver badges125 bronze badges

Xamarin Visual Studio Tutorial

Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.

Xamarin Visual Studio For Mac

Not the answer you're looking for? Browse other questions tagged xamarinvisual-studio-mac or ask your own question.