On 26/04/2010 21:40, Dino Viehland wrote:
Michael wrote:
Hello all,

The following code dies in Silverlight:

import clr
clr.AddReference("System.Xml")
"System.Xml" in [assembly.GetName().Name for assembly in clr.References]

SystemError: Security transparent method
System.Reflection.Assebly.GetName() cannot access
Microsoft.Scripting.Actions... using reflection.

This is making it less useful to port the IronPython dotnet integration
tutorial to Try Python. :-)

Repeated calls throw a slightly different error in the end (still a
system error - but a different message).
This is actually just a limitation inside of Silverlight.  For some reason
Assembly.GetName() is a security critical method and cannot be called.  It
also fails in a simple C# Hello world app with:

Attempt by security transparent method 
'SilverlightApplication1.MainPage..ctor()' to access security critical method 
'System.Reflection.Assembly.GetName()' failed.

I have no clue why this limitation exists (maybe some information disclosure
issue?)  but I think you could do:

AssemblyName(assembly.FullName).Name

Ok - thanks. I'll switch the example to do that instead. I created an issue for this, so you could add this as a comment and close it.

All the best,

Michael

instead.

_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog

READ CAREFULLY. By accepting and reading this email you agree, on behalf of 
your employer, to release me from all obligations and waivers arising from any 
and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, 
clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and 
acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your 
employer, its partners, licensors, agents and assigns, in perpetuity, without 
prejudice to my ongoing rights and privileges. You further represent that you 
have the authority to release me from any BOGUS AGREEMENTS on behalf of your 
employer.


_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to