9

When adding a new portable class Library project using visual studio 2012, in the add target window I can't find xamarin.ios and xamarin.android.

kadben
  • 185
  • 2
  • 14
  • 1
    possible duplicate of [xamarin support in Add Portable Class Library dialog](http://stackoverflow.com/questions/16678066/xamarin-support-in-add-portable-class-library-dialog) and http://stackoverflow.com/questions/16634788/creating-a-pcl-that-targets-monodroid – Stuart Jun 07 '13 at 13:27
  • note that official support for this is coming "very soon" to the alpha channel – Stuart Jun 07 '13 at 13:27

1 Answers1

16

Here is what you need to do. Follow the thread here, if you hit any issues.

  1. Open an explorer window to C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.0\Profile\Profile104\SupportedFrameworks
  2. Create a new file in the folder named 'MonoTouch.xml' and put in the following content

    <?xml version="1.0" encoding="UTF-8"?>
    <Framework MinimumVersion="4.0" MaximumVersion="*" Profile="*" Identifier="MonoTouch" DisplayName="MonoTouch"/>
    
  3. Create a new file in the folder named 'MonoAndroid.xml' and put in the following content

    <?xml version="1.0" encoding="UTF-8"?> 
    <Framework MaximumVersion="*" MinimumVersion="1.6" Profile="*" Identifier="MonoAndroid" DisplayName="Mono for Android"/>
    
  4. Restart Visual Studio if it is still open

  5. The options for MonoTouch and Mono for Android should now be available in the PCL enter image description here
Community
  • 1
  • 1
Mike Stonis
  • 2,184
  • 14
  • 24
  • For PCLs, you definitely can use .Net 4.0. This topic probably needs to be updated now as Visual Studio 2012/2013 and Xamarin Studio now include appropriate support for Xamarin.iOS and Xamarin.Android PCL platforms. http://docs.xamarin.com/guides/cross-platform/application_fundamentals/pcl/introduction_to_portable_class_libraries/ – Mike Stonis Apr 01 '14 at 14:02