简体   繁体   English

在DLL程序集中检索有关调用程序集的信息

[英]Retrieve info in DLL assembly about calling assembly

I have created several DLL (.NET) libraries that are used in several projects. 我创建了几个用于多个项目的DLL(.NET)库。 In these DLL libraries I want to know/retrieve which assembly (EXE) calls/uses the library, so if possible I want to know info like assembly name (EXE), strong name, version number, etc. 在这些DLL库中,我想知道/检索哪个程序集(EXE)调用/使用该库,因此,如果可能的话,我想知道诸如程序集名称(EXE),强名称,版本号等信息。

NB: Examples may be in C# or VB. 注意:示例可能在C#或VB中。 I use both languages. 我使用两种语言。

You can use System.Reflection => Assembly.GetCallingAssembly() should do the job. 您可以使用System.Reflection => Assembly.GetCallingAssembly()来完成这项工作。 http://msdn.microsoft.com/en-en/library/system.reflection.assembly.getcallingassembly.aspx http://msdn.microsoft.com/zh-CN/library/system.reflection.assembly.getcallingassembly.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM