简体   繁体   中英

how to add a windows phone project to existing Xamarin.Forms project

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???

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM