locked
PCL without Android an IOS support? RRS feed

  • Question

  • User83430 posted

    Hi everbody,

    I've installed Xamarin, Android, etc. Everything works fine. Now I want to build a Portable Library (PCL) but first without Android and IOS support (just .NET 4.5, WP 8, ...). So I opened up the Visual Studio project properties window and unchecked the Xamarin.Android and Xamarin.IOS target framework. After clicking ok, they still appear and are still checked. So I can't uncheck the target frameworks Andorid and IOS. I tried with Profile 78 and 259.

    Is it possible to create a PCL without Android and IOS support after installing the Xamarin suite?

    Best regards,

    Hannes

    Tuesday, November 11, 2014 12:40 PM

Answers

  • User83430 posted

    Sorry folks, my fault. I tried to install "PostSharp Model Pattern Libraray (Controls)" instead of "PostSharp Model Pattern Libraray". Now it works like a charm :-)

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, November 13, 2014 7:55 AM

All replies

  • User181 posted

    PCL profiles are weird. When you choose a profile you are choosing some subset of functionality for a certain set of platforms. There's no special support for those platforms in the PCL. You're just saying restrict the functions I can use to the ones in these platforms. In this case the other platforms you have selected have the same set of available APIs so that implicitly includes the Xamarin platforms. I think you should have seen a little message somewhere telling you that it checked those boxes for you. This is an innocuous change. It doesn't hurt anything.

    Tuesday, November 11, 2014 2:32 PM
  • User83430 posted

    Ok I understand. The problem is I try to use PostSharp which basically supports PCL. But it actually does not support Xamarin.Android and Xamarin.IOS as target framework. So it always tells me it can't add the references because the Xamarin target frameworks are beeing used. I haven't found any target framework in the .csproject file, I think this information could be in the profile. So maybe it is possible to copy an existing profile, give it a new number and remove Android and IOS? But how to do?

    Tuesday, November 11, 2014 2:45 PM
  • User181 posted

    That's not making sense to me. A PCL shouldn't be referencing Xamarin assemblies.

    Tuesday, November 11, 2014 3:08 PM
  • User83430 posted

    No, the PCL does not reference Xamarin assemblies. But I would like to reference a PostSharp assembly. This is done with NuGet. During NuGet installation I get the following error:

    Das Paket "PostSharp.Patterns.Model.Controls 4.0.35" konnte nicht installiert werden. Sie versuchen, dieses Paket in ein Projekt zu installieren, das sich auf "portable-net45+win+wpa81+wp80+MonoAndroid10+MonoTouch10" bezieht, das Paket enthält jedoch keine Assemblyverweise oder Inhaltsdateien, die mit diesem Framework kompatibel sind. Wenden Sie sich an den Paketersteller, um weitere Informationen zu erhalten.

    short english version:

    The modul "PostSharp.Patterns.Model.Controls 4.0.35" couldn't be installed. You try to install the modul into a project which tragets to "portable-net45+win+wpa81+wp80+MonoAndroid10+MonoTouch10" ... The NuGet module doesn't include suitable assemblies. ...

    I think the problems is that it targets to MonoAndroid and MonoTouch. The other plattfoprms are supported by PostSharp. So I would like to remove Android and IOS.

    Tuesday, November 11, 2014 8:25 PM
  • User181 posted

    It doesn't support the right PCL profile. You can ask that they add support for that PCL profile (or if you have the source maybe try porting it yourself), or you have to reference that assembly in the platform-specific projects and use a DependencyService to access it from within the PCL.

    Tuesday, November 11, 2014 8:58 PM
  • User18049 posted

    @HannesBischof? - It should be possible to install the PostSharp NuGet package into a PCL project that targets profile 78 or 259.

    My guess is that you have an old version of NuGet installed in Visual Studio that does not recognise the MonoAndroid target frameworks.

    Wednesday, November 12, 2014 9:35 AM
  • User83430 posted

    Sorry folks, my fault. I tried to install "PostSharp Model Pattern Libraray (Controls)" instead of "PostSharp Model Pattern Libraray". Now it works like a charm :-)

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, November 13, 2014 7:55 AM
  • User83430 posted

    The NuGet package PostSharp itself could be installed, but I try to install the NuGet package PostSharp Model Pattern Library. Refering to page 16 of the PostSharp user guide ( http://www.postsharp.net/downloads/documentation/PostSharp-4.0.pdf?action=download ) they support .NET 4,4.5;WP 8 (Silverlight);WP8.1;WIN 8,8.1. So I tought I could use a PCL, uncheck the Silverlight, Android and IOS support and install the PostSharp Model Pattern Library, but unfortunately it doesen't work.

    @mattward: Have you successfully tried to install the Model Pattern library into a PCL with profile 78 or 259?

    Monday, March 9, 2015 8:29 PM
  • User83430 posted

    The NuGet package PostSharp itself could be installed, but I try to install the NuGet package PostSharp Model Pattern Library. Refering to page 16 of the PostSharp user guide ( http://www.postsharp.net/downloads/documentation/PostSharp-4.0.pdf?action=download ) they support .NET 4,4.5;WP 8 (Silverlight);WP8.1;WIN 8,8.1. So I tought I could use a PCL, uncheck the Silverlight, Android and IOS support and install the PostSharp Model Pattern Library, but unfortunately it doesen't work.

    @mattward: Have you successfully tried to install the Model Pattern library into a PCL with profile 78 or 259?

    Monday, March 9, 2015 8:29 PM
  • User18049 posted

    Yes, I can install PostSharp.Patterns.Model version 4.0.43 into a portable class library project that targets Profile 78.

    Tuesday, March 10, 2015 9:46 AM