Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use reflection to iterate types in all referenced assemblies, in Silverlight?

Is there an equivilent to this in silverlight?

 var assemblies = AppDomain.CurrentDomain.GetAssemblies();

http://msdn.microsoft.com/en-us/library/system.appdomain.getassemblies(v=VS.95).aspx

Is there another way of doing this?

Here's a post on how to do it for design time under blend... but how at runtime?

http://joshsmithonwpf.wordpress.com/2010/01/06/the-ultimate-hack-for-silverlight-in-blend/


Doesn't look like this is possible:

Getting Runtime Assemblies in Silverlight 3

http://forums.silverlight.net/p/22050/77847.aspx

http://forums.silverlight.net/t/22050.aspx/1?Get+a+list+of+loaded+assemblies

like image 374
sgtz Avatar asked Aug 05 '11 21:08

sgtz


1 Answers

I'm not getting it to work in my SL4 project either, but I tried to cast the the current domain to a dynamic and it works, a dummy workaround until I get VS2010 to recognize that I' using the correct mscorlib.

Dummy workaround:

var loadedAssemblies = ((dynamic)Thread.GetDomain()).GetAssemblies()as Assembly[]; 
like image 154
Mattis Avatar answered Oct 17 '22 07:10

Mattis