In MSDN, it is said that AppDomain.GetAssemblies()
is supported in Silverlight 4 .
In my project, when I target the version 4 of Silverlight (I triple checked), I can't access to the GetAssemblies()
method on AppDomain
as shown in the screenshot below:
If I try anyway, it won't compile. I can workaround this using the following piece of code:
dynamic domain = AppDomain.CurrentDomain;
var assemblies = domain.GetAssemblies();
It compiles and seem to be working fine but only under Silverlight client 5.X and Silverlight 4.0.60351 and above from my tests. It doesn't work for below versions of the client. The project in question is the entry point of my Silverlight application.
Googling on this topic mainly says that it is supported...
So my questions are:
AppDomain.CurrentDomain.GetAssemblies()
in the IDE without the above workaround? Is there something I missed? In case it can be useful, I have the following installed on my desktop:
I didn't try to uninstall/reinstall anything (yet) to avoid losing a whole day in this tedious task...
--
Edit: It appears that GetAssemblies()
method is not present on AppDomain
class in mscorlib.dll for SL4. So I guess MSDN documentation is incorrect and the runtime SL4 client has been patched at some point for some reason (compatibility with SL5-compiled applications?)...
I also stumpled upon these (see my comment on MSDN page ) behavior or wrong documentation in the MSDN and tried many diffrent ways to get the method call GetAssemblies in Siverlight 4. The solution for me was to install Silverlight 5 and change my silverlight project to work with Silverlight 5.
My suggestion is that the method GetAssemblies was added later, by a patch or silverlight update to the silverlight runtime.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.