[mono-android] Problem with reflection
Hello, i'm filling classproperties over reflection. After outsourcing the code into a library-project i get the following exception: System.ArgumentException: Set Method not found for 'Standardwert' at System.Reflection.MonoProperty.SetValue (System.Object obj, System.Object value, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] index, System.Globalization.CultureInfo culture) [0x0] in :0 at System.Reflection.PropertyInfo.SetValue (System.Object obj, System.Object value, System.Object[] index) [0x0] in :0 It is in a simple class with nothing special. 'Standardwert' is a pulbic string property (get, set). Under Debug (no linking) the code runs without problems. Under Release (with linking sdk & user) the exception occurs. Under Release (no linking) the code runs without problems. The library-project is linked to the main-project. My Xamarin.iOS-Version is 4.8.1. I'm on windows 7. Anyone any ideas? Lee -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Problem-with-reflection-tp5713582.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] Problem with reflection
On Oct 18, 2013, at 10:57 AM, JLee wrote: > After outsourcing the code into a library-project i get the following > exception: > > System.ArgumentException: Set Method not found for 'Standardwert' The property has been removed by the linker. It doesn't exist. > Under Release (with linking sdk & user) the exception occurs. Do not link "Sdk and User Assemblies" unless you _really_ want to. Hint: You almost never want to. Use "Sdk Assemblies Only". - Jon ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] Problem with reflection
I always thought, that the linker only removes complete unused classes. didn't know, that the linker removes single properties. thanks for this info. Due to a large apk-size (30mb without linking / 8mb with full linking) I always used link sdk + user to get the smallest possible size. When I use "Link SDK only" I get the following compiler-error: Fehler 13 Unerwarteter Fehler bei der LinkAssemblies-Aufgabe. (error 13 unexpected error at linkassemblies-task) Mono.Cecil.ResolutionException: Failed to resolve System.Void System.Console::set_ForegroundColor(System.ConsoleColor) bei Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference) bei Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction) bei Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body) bei Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method) bei Mono.Linker.Steps.MarkStep.ProcessQueue() bei Mono.Linker.Steps.MarkStep.Process() bei Mono.Linker.Steps.MarkStep.Process(LinkContext context) bei Mono.Linker.Pipeline.Process(LinkContext context) bei MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context) bei Xamarin.Android.Tasks.LinkAssemblies.Execute() bei Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() bei Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext() regards Lee -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Problem-with-reflection-tp5713582p5713584.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid
Re: [mono-android] Problem with reflection
I workedaround this by using "linking sdk + user" and putted my library-assembly in the "skip linking" section. But for future things, maybe we can still fix my problem with "linking sdk only" ?! regards Lee -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/Problem-with-reflection-tp5713582p5713585.html Sent from the Mono for Android mailing list archive at Nabble.com. ___ Monodroid mailing list Monodroid@lists.ximian.com UNSUBSCRIBE INFORMATION: http://lists.ximian.com/mailman/listinfo/monodroid