Re: [mono-android] Release version errors

2012-08-23 Thread Sayed Arian Kooshesh
reflection, inho, has always been the sign of a bad idea. Reflection .. is slow and cumbersome and (generally, yes I'm aware of the exceptions) should NEVER make it to production code. I would offer up the IS operator (though slightly expensive, it's not bad compared to reflection) and then do you

Re: [mono-android] Release version errors

2012-08-23 Thread Jonathan Pryor
On Aug 14, 2012, at 12:00 PM, Goncalo Oliveira wrote: > Because the content is dynamic and so is the property getter. I don't fully understand how this works. Is everything truly unbounded, or are there some type restrictions you can employ? Do you have an example you can share? - Jon __

Re: [mono-android] Release version errors

2012-08-16 Thread Matthew Leibowitz
IE seems to be doing some weird sending/crashing/reposting. On Thu, Aug 16, 2012 at 7:14 PM, Matthew Leibowitz wrote: > Hi > > Maybe this could give you some ideas: (T4 Templates) > > > <#@ template debug="false" hostspecific="false" language="C#" #> > <#@ assembly name="System.Core" #> > <#@ im

Re: [mono-android] Release version errors

2012-08-16 Thread Matthew Leibowitz
Hi Maybe this could give you some ideas: (T4 Templates) <#@ template debug="false" hostspecific="false" language="C#" #> <#@ assembly name="System.Core" #> <#@ import namespace="System.Reflection" #> <#@ import namespace="System.Collections.Generic" #> <#@ output extension=".cs" #> using System.

Re: [mono-android] Release version errors

2012-08-16 Thread Matthew Leibowitz
fo info in typeof(PropertyInfo).GetProperties()) { #> var value<#= info.Name #> = list.<#= info.Name #>; <# } #> } } Sent from my Windows 8 PC <http://windows.microsoft.com/consumer-preview> *From:* Goncalo Oliveira *Sent:* 16 August 2012 10:48:09 AM *To:* Discussions related to Mo

Re: [mono-android] Release version errors

2012-08-16 Thread Goncalo Oliveira
Types and... properties... oh boy, that's gonna be fun! Well that or... turn off linking on Mono.Android and get a 18mb file. There should be a way of doing this without all this hassle. At least for a type's properties. If at least there was a way to teach the linker which types to preserve and h

Re: [mono-android] Release version errors

2012-08-15 Thread Meinrad Recheis
Your only option seems to be to completely specialize this routine into a switch statement that handles all possible types :-/ -- MR On 14.08.2012 11:26, Goncalo Oliveira wrote: > I'm kind of lost here. I've found exactly what's failing and where. I > have some code that's basically trying to do t

Re: [mono-android] Release version errors

2012-08-14 Thread Goncalo Oliveira
No other thoughts? On 14 August 2012 17:00, Goncalo Oliveira wrote: > Because the content is dynamic and so is the property getter. > > > On 14 August 2012 16:18, Jonathan Pryor wrote: > >> On Aug 14, 2012, at 6:15 AM, Goncalo Oliveira wrote: >> > The thing is... this is kind of unusable. The

Re: [mono-android] Release version errors

2012-08-14 Thread Goncalo Oliveira
Because the content is dynamic and so is the property getter. On 14 August 2012 16:18, Jonathan Pryor wrote: > On Aug 14, 2012, at 6:15 AM, Goncalo Oliveira wrote: > > The thing is... this is kind of unusable. The whole reason I'm using > reflection is because I don't know which properties I mi

Re: [mono-android] Release version errors

2012-08-14 Thread Jonathan Pryor
On Aug 14, 2012, at 6:15 AM, Goncalo Oliveira wrote: > The thing is... this is kind of unusable. The whole reason I'm using > reflection is because I don't know which properties I might need. I don't understand this; why is Reflection preferable to using type checking? Why wouldn't you know whi

Re: [mono-android] Release version errors

2012-08-14 Thread Goncalo Oliveira
I managed to get around this using the falseflag. Something like this #pragma warning disable 0219, 0649 static bool falseflag = false; static SplashActivity() { if ( falseflag ) { var preserveSpinner = new Android.Widget.Spinner( And

Re: [mono-android] Release version errors

2012-08-14 Thread Goncalo Oliveira
I'm kind of lost here. I've found exactly what's failing and where. I have some code that's basically trying to do this: Type targetType = Target.GetType(); // type is Android.Widget.Spinner PropertyInfo getterProperty = targetType.GetProperty( getterPath ); In release getterProperty is returning

Re: [mono-android] Release version errors

2012-07-25 Thread Jonathan Pryor
On Jul 24, 2012, at 5:45 AM, Goncalo Oliveira wrote: > Let me see if I get this straight. I do have an additional project that is > referenced by the application. It's basically the data model classes. I need > to add the "[Android.Runtime.Preserve(AllMembers=true)]" attribute to the > classes

Re: [mono-android] Release version errors

2012-07-24 Thread Goncalo Oliveira
Any more thoughts on this? Cheers On 24 July 2012 10:45, Goncalo Oliveira wrote: > Thank you for the reply Jon. > It seems that the linker is indeed causing this. I rebuilt with no linking > and everything works fine. Problem is it generates a 22 mb file instead of > a 8 mb one. > > Let me see

Re: [mono-android] Release version errors

2012-07-24 Thread Goncalo Oliveira
Thank you for the reply Jon. It seems that the linker is indeed causing this. I rebuilt with no linking and everything works fine. Problem is it generates a 22 mb file instead of a 8 mb one. Let me see if I get this straight. I do have an additional project that is referenced by the application. I

Re: [mono-android] Release version errors

2012-07-23 Thread Jonathan Pryor
On Jul 23, 2012, at 12:46 PM, Goncalo Oliveira wrote: > So... maybe there's a guide somewhere on this? Common errors, things to > avoid, anything?... The most common source of errors is due to linking; a type/member that you're referencing no longer exists: http://docs.xamarin.com/andro

[mono-android] Release version errors

2012-07-23 Thread Goncalo Oliveira
Hi, I'm getting a lot of exceptions with the release version that I didn't have with the debug one. It's getting hard to trace them all, because even though I can get the stacktraces from ddms, I can't replicate them in the debug version, so it's kind of difficult to know what's wrong! So... mayb