[mono-android] "The referenced project is targetted to a different framework family (MonoAndroid)"
Tom Opgenorth
tom at opgenorth.net
Tue Jan 24 19:06:34 UTC 2012
Good info - thanks. Last night I was playing with TypeMock instead of
Rhino.Mocks, and again, everything seemed to "just work". TypeMock
could create the fakes I needed for a Context and functioned as I
would expect it to. Based on what you're saying though, it seems that
this is based more on luck than anything.
Not against breaking out the business logic and am actually headed
that way but as this is a side-project things go slowly. Of course,
it does make me wonder about things like the Android context and such.
Usually I just put wrappers around those kind of "unmockable" things
so not a big deal (although can be a bit of yak-shaving).
As well, for fear of being pedantic, it does look like Andr.Unit is
more of a functional testing framework. Definitely useful, but it's
not a unit test framework (which is what I'm focusing on ATM).
On Tue, Jan 24, 2012 at 11:27, Jonathan Pryor <jonp at xamarin.com> wrote:
> On Jan 23, 2012, at 11:49 PM, Tom Opgenorth wrote:
>> For the test assembly I then added references to Xunit, Rhino.Mocks, my M4A project, and Mono.Android.dll.
>
> No can do. :-)
>
> The problem is that the assemblies are incompatible: Xunit, Rhino.Mocks, and (presumably) your test assembly are going to want mscorlib.dll 2.0/4.0. Your M4A assembly and Mono.Android.dll want mscorlib.dll 2.0.5.0, which is not compatible with mscorlib.dll 2.0/4.0, thus generating your warning:
>
>> I get the warning "The project 'net.opgenorth.m4a.mytrips' cannot be referenced. The referenced project is targeted to a different framework family (MonoAndroid)" showing up.
>
> The current solution is to remove the Mono.Android.dll dependencies from your M4A assembly (which presumably contains business logic), and then have two projects for this business logic assembly: one targeting .NET, and one targeting Mono for Android. The .NET assembly can be used by your unit tests, while the Mono for Android project can be used by your Mono for Android application.
>
> Alternatively, you'll need to use a unit test engine that works within Mono for Android, such as Andr.Unit:
>
> http://spouliot.wordpress.com/2011/10/30/andr-unit-joins-the-family/
>
> Is this ideal? No. We'll be working over time to improve the situation, but it'll be awhile.
>
> - Jon
>
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
--
http://www.opgenorth.net
More information about the Monodroid
mailing list