Using Shared Library In Xamarin Visual Studio For Mac

Using Shared Library In Xamarin Visual Studio For Mac

  1. Xamarin Visual Studio For Mac
  2. Using Shared Library In Xamarin Visual Studio For Mac
  3. Xamarin Visual Studio Tutorial
Viewed 40 times

All I'm trying to do is do what I would normally have done in full Visual Studio -- put code in a child project and reference that project from a parent project.

I have created a solution in Xamarin (Visual Studio for Mac) that has: MyGame (solution) > MyGame > MyGame.Droid > MyGame.IOS > MyLibrary. Visual Studio for Mac. Steps to reproduce boils down to creating either a Xamarin Android or Xamarin Forms solution, adding either a Dynamic Shared Lib or Cross.

  1. Install Visual Studio Community Edition for Mac from the Xamarin home page.

  2. Create a Xamarin Forms app and call it MyApp. Choose Android and iOS targets. That gets you a solution with the following projects in it:MyAppMyApp.DroidMyApp.iOS

  3. Right click the solution and say 'Add New Project'. Choose Multiplatorm -> Portable Library (or anything else). Call it 'bob'.

  4. See bob in the solution?

  5. How do you add a reference to bob from MyApp?

Xamarin Visual Studio For Mac

While we are on this, how do we add a NuGet package reference to MyApp? You can add one to MyApp.Droid, MyApp.iOS and bob (try it -- right click on each project, Add -> Add NuGet Packages

Using Shared Library In Xamarin Visual Studio For Mac

Using Shared Library In Xamarin Visual Studio For Mac

Xamarin visual studio for mac

Darn'dest thing isn't it?

NOTE: My first guess was that it's a limitation of the free stuff. Well, that doesn't seem to hold up because you can add references between all the other projects. For all of that to be useful in my case, I need to be able to add a reference to the main one (the one with the App.xaml in it)

010110110101010110110101

Xamarin Visual Studio Tutorial

5,70119 gold badges72 silver badges127 bronze badges
Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.

Browse other questions tagged xamarinxamarin.iosxamarin.androidvisual-studio-community or ask your own question.