反射中的 .NET Framework 程序集
我有一组使用反射的程序集。我想循环遍历它们,但我想忽略 .NET 框架或 ASP.NET 框架 DLL。程序集上是否有一个属性标记其来自 .NET 框架?或者有其他的称呼吗?
我正在查看名称,如果程序集的名称以 System、Microsoft 或 mscorlib 开头,我将忽略它。但我想知道是否有一个标志可以让我变得更容易?
I have a collection of assemblies using reflection. I want to loop through them, but I would like to ignore the .NET framework or ASP.NET framework DLL's. Is there an attribute on the assembly that marks that its from the .NET framework? Or any other designation?
I was looking at the name, and if the name of the assembly starts with System, Microsoft, or mscorlib, I am ignoring it. But I was wondering if there is a flag I can use to make this even easier?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“GlobalAssemblyCache”属性是否符合您的要求?
http://msdn.microsoft.com/en-us /library/system.reflection. assembly.globalassemblecache.aspx
可能还取决于您加载程序集集合的方式。如果上述建议不适合您,请澄清。
Does the "GlobalAssemblyCache" property qualify for your requirement?
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.globalassemblycache.aspx
Propably also depends on how you are loading your assemblies collection. If the above mentioned suggestion doesn't work for you, please clarify that.
您可能会找到这个答案 到相关问题 有用的
You might find this answer to a related question useful