Botz3000
Botz3000

Reputation: 39610

ReflectionPermission Exception

I am currently working on an application using WPF and MVVM. Now if I go to another user's machine and try to launch my app, I get an Exception due to missing ReflectionPermission at BindToMethodInfo(Object, RuntimeMethodHandle, RuntimeTypeHandle, DelegateBindingFlags) in mscorlib.

Now my question is, what exactly requires the ReflectionPermission other than accessing private/protected properties? The properties I am binding to are all public and the ViewModel as well as the classes it uses are in the same assembly as the window that is binding to it.

Upvotes: 2

Views: 643

Answers (1)

Akash Kava
Akash Kava

Reputation: 39916

Try deploying application with ClickOnce by giving full trust.

The reason microsoft came up with DependencyProperties and such other concepts to avoid use of reflection as it requires this permission. However, either you can create a manifest that will require administrative rights to run the program or deploying with clickonce should help.

Upvotes: 2

Related Questions