Friday, October 12, 2012

Silverlight 5 Out of Brower with Elevated Trust application with MEF

Silverlight 5 Out of Brower with Elevated Trust application with MEF

I want to use MEF in a Silverlight 5 Out of Browser application with Elevated Privileges.

I am having issues when using MEF and getting the exception when the following line of code is being executed

CompositionInitializer.SatisfyImports(this); 

{System.TypeLoadException: Inheritance security rules violated while overriding member: 'System.Exception.get_InnerException()'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.

Excemption Message says Inheritance security rules violated while overriding member: 'System.Exception.get_InnerException()'. Security accessibility of the overriding method must match the security accessibility of the method being overriden.

I have tried downloading couple of MEF samples from internet. All were silverlight 4 applications. I converted the application to use Silverlight 5 runtime and the application fails at he above line of code mentioned.

This is what I found on silverlight.net forums

Answers & Comments...

Answer: 1

This is a stupid error which I also had, what worked for me was I changed the Target framework of my shell project to Silverlight 4, ran it, saw it work, then changed back to Silverlight 5 and it still worked.

by : DonJuanJeromehttp://stackoverflow.com/users/1520157




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog