internal static IClrStrongName GetInstance()
        {
            Guid metaHostClsid = new Guid(unchecked ((int)0x9280188D), 0xE8E, 0x4867, 0xB3, 0xC, 0x7F, 0xA8, 0x38, 0x84, 0xE8, 0xDE);

            Guid metaHostGuid       = new Guid(unchecked ((int)0xD332DB9E), unchecked ((short)0xB9B3), 0x4125, 0x82, 0x07, 0xA1, 0x48, 0x84, 0xF5, 0x32, 0x16);
            Guid clrStrongNameClsid = new Guid(unchecked ((int)0xB79B0ACD), unchecked ((short)0xF5CD), 0x409b, 0xB5, 0xA5, 0xA1, 0x62, 0x44, 0x61, 0x0B, 0x92);
            Guid clrRuntimeInfoGuid = new Guid(unchecked ((int)0xBD39D1D2), unchecked ((short)0xBA2F), 0x486A, 0x89, 0xB0, 0xB4, 0xB0, 0xCB, 0x46, 0x68, 0x91);
            Guid clrStrongNameGuid  = new Guid(unchecked ((int)0x9FD93CCF), 0x3280, 0x4391, 0xB3, 0xA9, 0x96, 0xE1, 0xCD, 0xE7, 0x7C, 0x8D);

            IClrMetaHost    metaHost = (IClrMetaHost)nCreateInterface(metaHostClsid, metaHostGuid);
            IClrRuntimeInfo runtime  = (IClrRuntimeInfo)metaHost.GetRuntime(GetRuntimeVersion(), clrRuntimeInfoGuid);

            return((IClrStrongName)runtime.GetInterface(clrStrongNameClsid, clrStrongNameGuid));
        }
示例#2
0
 /// <summary>
 /// Gets an interface provided by this runtime, such as ICLRRuntimeHost.
 /// </summary>
 /// <typeparam name="TInterface">The interface type to be returned.  This must be an RCW interface</typeparam>
 /// <param name="clsid">The CLSID to be created</param>
 public TInterface GetInterface <TInterface>(Guid clsid)
 {
     return((TInterface)_RuntimeInfo.GetInterface(clsid, typeof(TInterface).GUID));
 }