Are you loading an assembly from the local disk, and then calling Assembly.Load(byte[])?
That particular function is attributed [SecurityCritical] so Silverlight prevents you from calling it from your own code. You can, however, download an assembly from the server and then load it with Assembly.Load(string)...
that is correct: silverlight has a "simplified" security system (when compared with the full .net framework) and there are several restrictions associated with calling public methods of the API. here are a couple of posts that explain what's going on:
maruszek
0 Points
1 Post
Loading user-selected assembly
Sep 27, 2007 06:35 PM | LINK
Hi!
Is it possible to load an assembly selected by user? When I'm trying to use Assembly.Load I get this exception:
System.MethodAccessException: Attempt to access the method failed: System.Reflection.Assembly.Load(Byte[])
If it's not possible then why there is Assembly.Load method available?
jrpowers
Member
72 Points
26 Posts
Re: Loading user-selected assembly
Sep 27, 2007 07:02 PM | LINK
Are you loading an assembly from the local disk, and then calling Assembly.Load(byte[])?
That particular function is attributed [SecurityCritical] so Silverlight prevents you from calling it from your own code. You can, however, download an assembly from the server and then load it with Assembly.Load(string)...
luisabreu
Participant
1676 Points
612 Posts
Re: Loading user-selected assembly
Sep 28, 2007 08:41 PM | LINK
hello.
that is correct: silverlight has a "simplified" security system (when compared with the full .net framework) and there are several restrictions associated with calling public methods of the API. here are a couple of posts that explain what's going on:
http://blogs.msdn.com/shawnfa/archive/2007/05/09/the-silverlight-security-model.aspx
http://blogs.msdn.com/shawnfa/archive/2007/05/10/silverlight-security-ii-what-makes-a-method-critical.aspx
http://blogs.msdn.com/shawnfa/archive/2007/05/11/silverlight-security-iii-inheritance.aspx