Quantcast

Problem with reflection

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem with reflection

JLee
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) [0x00000] in <filename unknown>:0
  at System.Reflection.PropertyInfo.SetValue (System.Object obj, System.Object value, System.Object[] index) [0x00000] in <filename unknown>: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

 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with reflection

Jonathan Pryor-2
On Oct 18, 2013, at 10:57 AM, JLee <[hidden email]> 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
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with reflection

JLee
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.<ExecuteInstantiatedTask>d__20.MoveNext()


regards
Lee
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with reflection

JLee
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with reflection

Ctls_Rajesh
Nice thought for work on library management...

See here and solve yr problem

http://www.freestudentprojects.com/java-projects/library-management-system-3/
Classteacher Learning Systems - Google Play Store | iTunes Play Store
Loading...