Ejemplo n.º 1
0
 public static string QueryAssemblyInfo(string assemblyName)
 {
     if (assemblyName == null)
     throw new ArgumentException(Resources.INVALID_ASSEMBLYNAME, "assemblyName");
       NativeMethods.AssemblyInfo assemblyInfo = new NativeMethods.AssemblyInfo();
       assemblyInfo.cchBuf = 1024;
       assemblyInfo.currentAssemblyPath = new string(char.MinValue, assemblyInfo.cchBuf);
       NativeMethods.IAssemblyCache ppAsmCache = (NativeMethods.IAssemblyCache) null;
       NativeMethods.CreateAssemblyCache(out ppAsmCache, 0);
       ppAsmCache.QueryAssemblyInfo(0, assemblyName, ref assemblyInfo);
       return assemblyInfo.currentAssemblyPath;
 }
Ejemplo n.º 2
0
 public static string QueryAssemblyInfo(string assemblyName)
 {
     if (assemblyName == null)
     {
         throw new ArgumentException(Resources.INVALID_ASSEMBLYNAME, "assemblyName");
     }
     NativeMethods.AssemblyInfo assemblyInfo = new NativeMethods.AssemblyInfo();
     assemblyInfo.cchBuf = 1024;
     assemblyInfo.currentAssemblyPath = new string(char.MinValue, assemblyInfo.cchBuf);
     NativeMethods.IAssemblyCache ppAsmCache = (NativeMethods.IAssemblyCache)null;
     NativeMethods.CreateAssemblyCache(out ppAsmCache, 0);
     ppAsmCache.QueryAssemblyInfo(0, assemblyName, ref assemblyInfo);
     return(assemblyInfo.currentAssemblyPath);
 }