Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single code base for monodroid, WP7 and silverlight

I've been playing about with the monodroid (preview 8980) and I'm trying to create an application that will run on Android, WP7 and silverlight.

My plan is to create a single core class library and then a seperate project for each of the platforms that will contain the UI stuff - so one monodroid project, one for WP7 and a SL one, all of which will reference the core class library.

The main problem with this is that it will be possible to implement some functionality in the core library that will work fine on silverlight, but not on WP7 for instance. I believe the best way to make sure this doesn't happen is by making the core library a silverlight 3 project, as this will be the lowest common denominator.

The problem I am facing now is that I can't reference a SL3 library from the monodroid project. I get this warning - 'Warning 2 The project 'TMCore' cannot be referenced. The referenced project is targeted to a different framework family (Silverlight)'

Any ideas?

like image 235
Tom Avatar asked Dec 24 '10 20:12

Tom


2 Answers

Bah I seam to always end up answering my own questions - http://www.gregshackles.com/2010/12/shared-libraries-for-windows-phone-7-monodroid-and-beyond/

like image 96
Tom Avatar answered Nov 11 '22 05:11

Tom


according to

http://monodroid.net/Documentation/Assemblies

you must compile your core-stuffe into a seperate assembly you cannot share a core-dll.

> Note: MonoDroid is not ABI compatible with existing assemblies compiled for 
> a different profile.  You must recompile your source code to generate 
> assemblies targeting the MonoDroid profile (just as you need to recompile 
> source code to target Silverlight and .NET 3.5 separately).
like image 26
k3b Avatar answered Nov 11 '22 06:11

k3b