Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setup of xamarin studio to work with PCL & MVVMCross

I really enjoy Xamarin Studio and I'm looking for a template solution to start developing a cross devices application with MvvmCross.

But I can't find how to set a project to work with PCL and MvvmCross with Xamarin Studio.

If anyone can give me a link where I can find a tutorial to make it, it would be awesome.

I would be very pleased to contribute to this community by giving my feedback and providing some tutorial about how to start using Xamarin Studio, PCL MvvmCross and get rid of Visual Studio :D

like image 472
Nk54 Avatar asked Mar 25 '13 11:03

Nk54


People also ask

Can you still use PCL in Visual Studio?

Portable Class Libraries (PCL) Portable Class Libraries (PCLs) are considered deprecated in the latest versions of Visual Studio. While you can still open, edit, and compile PCLs, for new projects it is recommended to use .NET Standard libraries to access a larger API surface area.

Why can’t I use a Windows DLL on Xamarin?

When you create an Application Project or a Library Project, the resulting DLL is restricted to working on the specific platform it is created for. This prevents you from writing an assembly for a Windows app, and then re-using it on Xamarin.iOS and Xamarin.Android.

How do I add a PCL to my project?

Tick the platforms you need to support and press OK. The PCL project will appear as shown in the Solution Explorer – the text (Portable) appears beside the project name to indicate it is a PCL: The PCL is now ready for code to be added.

What are portable class libraries (PCLS)?

Portable Class Libraries (PCLs) are deprecated in the latest versions of Visual Studio. For new projects it is recommended to use .NET Standard libraries to access a larger API surface area.


2 Answers

As @duDE's answer pointed out, for working in Visual Studio on the PC in the pre-Xamarin2.0 world, there were quite detailed instructions available on http://slodge.blogspot.de/2012/12/cross-platform-winrt-monodroid.html

As various releases of Xamarin 2.0 have been released over the last month, these type of instructions have become more and more difficult to keep up to date... and this situation is likely to continue for a little while yet as Xamarin are currently adding:

  • .Net 4.5 (Mono 3) support
  • async/await support
  • PCL support

This work is being done with some urgency, but without any official target date - so I'm afraid there isn't any easy way to predict dates for Alpha, Beta or final availability.


For the current OSX setup, I think you can use:

  • the current XamarinStudio/MonoDevelop - 4.0.2
  • the current stable Xamarin.iOS/MonoTouch and Xamarin.Android/MonoDroid - do not use the Aplha channel

For the current PC setup, I think you can cannot use Xamarin.iOS, but you can use:

  • VS2010 or VS2012
  • the current stable Xamarin.Android/MonoDroid - do not use the Aplha channel
  • with just a couple of changes:
    • you need to add two supported framework xml files - one for Android and one for MonoTouch - you can find these on http://slodge.blogspot.co.uk/2013/03/xamarinios-with-mvvmcross-in-vs2012.html

For discussions on getting things building and running, don't use StackOverflow - instead use one of:

  • http://forums.xamarin.com/discussion/1549/pcls-and-mvvmcross-in-the-new-tools#latest

as a backup you can also try https://jabbr.net/#/rooms/mvvmcross


Don't even think about trying to get an MvvmCross app built - on the free version of Xamarin - it's limits are way too low for any app I've tried to build.


If you are looking for some starting app templates, use: https://github.com/slodge/MvvmCross-Templates

If you are looking for some pre-built binaries, use one one of the folders on: https://github.com/slodge/MvvmCross-Binaries - please note that portable libraries built on the Mac are not portable across to the PC (or vice versa) - they will be 'soon' but not yet.


Sorry for the fact that we don't have a neater, finished solution... we've now been fighting to hack PCLs into Xamarin for a year. However, the good news is that really soon that battle will be over and we can all get on with the apps :)


I guarantee this answer is out of date inside a week...

like image 141
Stuart Avatar answered Dec 21 '22 13:12

Stuart


Xamarin.Studio 4.2 allows you to create PCL projects.

like image 41
Stephane Delcroix Avatar answered Dec 21 '22 11:12

Stephane Delcroix