0
votes

I created a Xamarin.Forms Shared project in Xamarin Studio, so it did not add iOS or windows Phone project so I added it from Visual Studio then I added Xamarin.Forms package from nuget to both project now when I try to add the shared library to both ios and winphone by right clicking on references and add references, under solution I don't see the shared library only droid library is visible

i went through the Xamarin Docs i am following exactly what is written, what am i missing, or it is possible only in portable projects???

2

2 Answers

0
votes

What version of Visual Studio are you using? VS 2015 now has baked in support for add shared project references. If you are using 2013 or lower, you need to download the visual studio extension to add shared project references. It will then be in the right-click context menu.

https://visualstudiogallery.msdn.microsoft.com/315c13a7-2787-4f57-bdf7-adae6ed54450

0
votes

The easiest way to create a Xamarin.Forms solution is to create it from Visual Studio as Xamarin Studio doesn't support Windows Phone at all and iOS projects on Windows.

In your case check if you have Windows Phone 8 SDK installed (not 8.1, not 7). You can get it from this site. Then create new Windows Phone 8 Silverlight project (again you will be asked to target 8.1 - no, you should target 8.0). Then add Xamarin.Forms nuget package.

The best way to have shared code is to use Portable Class Library targeting Xamarin.Android, Xamarin.iOS and Windows Phone 8 (IMHO).

If all of these doesn't work, could you share your code?