在Silverlight 3中获取运行时程序集 [英] Getting Runtime Assemblies in Silverlight 3

查看:57
本文介绍了在Silverlight 3中获取运行时程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在编写一个具有AssemblyHelper的框架dll. 该帮助程序存储运行时程序集和UserAdded程序集,以轻松实例化新对象.

I am currently writing a framework dll which has an AssemblyHelper. This helper stores Runtime and UserAdded assemblies to easily instantiate new objects.

框架的.NET部分使用:

The .NET part of the framework uses:

AppDomain MyDomain = AppDomain.CurrentDomain;
Assembly[] AssembliesLoaded = MyDomain.GetAssemblies();
_runtimeAssemblies = AssembliesLoaded;

这为我提供了我需要的所有程序集.

This gets me all the assemblies I need.

但是问题是我不能在Silverlight中使用它,也不知道现在该使用什么. 目前我正在使用:

But the problem is I can't use this with Silverlight and I have no idea what to use now. Currently I am using:

Assembly[] AssembliesLoaded = {Assembly.GetCallingAssembly()};

但这只会添加我框架的Assembly,而不会添加应用程序或任何其他运行时程序集之一.

But this only adds the Assembly of my framework and not the one of the application or any other runtime assembly.

我应该使用什么?请帮忙!

What should I use? please help!

预先感谢

Wouter

推荐答案

System.Windows.Deployment类是您最接近应用程序中程序集列表的类.

The System.Windows.Deployment class is the closest you are going to get to the list of assemblies in the application.

Deployment.Current.Parts集合是AssemblyPart对象的列表,该对象指定Xap中打包的各个dll的名称和源uri.

The Deployment.Current.Parts collection is a list the AssemblyPart object that specify the name and source uri of the individual dlls packaged in the Xap.

我不确定这对您有多大帮助.

I'm not sure that is much of a help to you though.

这篇关于在Silverlight 3中获取运行时程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆