本文整理汇总了C#中System.Reflection.AssemblyName.SetHashControl方法的典型用法代码示例。如果您正苦于以下问题:C# AssemblyName.SetHashControl方法的具体用法?C# AssemblyName.SetHashControl怎么用?C# AssemblyName.SetHashControl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.AssemblyName
的用法示例。
在下文中一共展示了AssemblyName.SetHashControl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InternalLoadFrom
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
internal static RuntimeAssembly InternalLoadFrom(String assemblyFile,
Evidence securityEvidence,
byte[] hashValue,
AssemblyHashAlgorithm hashAlgorithm,
bool forIntrospection,
bool suppressSecurityChecks,
ref StackCrawlMark stackMark)
{
if (assemblyFile == null)
throw new ArgumentNullException("assemblyFile");
Contract.EndContractBlock();
#if FEATURE_CAS_POLICY
if (securityEvidence != null && !AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled)
{
throw new NotSupportedException(Environment.GetResourceString("NotSupported_RequiresCasPolicyImplicit"));
}
#endif // FEATURE_CAS_POLICY
AssemblyName an = new AssemblyName();
an.CodeBase = assemblyFile;
an.SetHashControl(hashValue, hashAlgorithm);
// The stack mark is used for MDA filtering
return InternalLoadAssemblyName(an, securityEvidence, null, ref stackMark, true /*thrownOnFileNotFound*/, forIntrospection, suppressSecurityChecks);
}
示例2: InternalLoadFrom
internal static RuntimeAssembly InternalLoadFrom(string assemblyFile, System.Security.Policy.Evidence securityEvidence, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, bool forIntrospection, bool suppressSecurityChecks, ref StackCrawlMark stackMark)
{
if (assemblyFile == null)
{
throw new ArgumentNullException("assemblyFile");
}
if ((securityEvidence != null) && !AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled)
{
throw new NotSupportedException(Environment.GetResourceString("NotSupported_RequiresCasPolicyImplicit"));
}
AssemblyName assemblyRef = new AssemblyName {
CodeBase = assemblyFile
};
assemblyRef.SetHashControl(hashValue, hashAlgorithm);
return InternalLoadAssemblyName(assemblyRef, securityEvidence, ref stackMark, forIntrospection, suppressSecurityChecks);
}
示例3: InternalLoadFrom
private static Assembly InternalLoadFrom(String assemblyFile,
Evidence securityEvidence,
byte[] hashValue,
AssemblyHashAlgorithm hashAlgorithm,
bool forIntrospection,
ref StackCrawlMark stackMark)
{
if (assemblyFile == null)
throw new ArgumentNullException("assemblyFile");
AssemblyName an = new AssemblyName();
an.CodeBase = assemblyFile;
an.SetHashControl(hashValue, hashAlgorithm);
return InternalLoad(an, securityEvidence, ref stackMark, forIntrospection);
}
示例4: InternalLoadFrom
private static Assembly InternalLoadFrom(string assemblyFile, System.Security.Policy.Evidence securityEvidence, byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, bool forIntrospection, ref StackCrawlMark stackMark)
{
if (assemblyFile == null)
{
throw new ArgumentNullException("assemblyFile");
}
AssemblyName assemblyRef = new AssemblyName {
CodeBase = assemblyFile
};
assemblyRef.SetHashControl(hashValue, hashAlgorithm);
return InternalLoad(assemblyRef, securityEvidence, ref stackMark, forIntrospection);
}
示例5: InternalLoadFrom
[MethodImplAttribute(MethodImplOptions.NoInlining)] // Methods containing StackCrawlMark local var has to be marked non-inlineable
internal static RuntimeAssembly InternalLoadFrom(String assemblyFile,
Evidence securityEvidence,
byte[] hashValue,
AssemblyHashAlgorithm hashAlgorithm,
bool forIntrospection,
bool suppressSecurityChecks,
ref StackCrawlMark stackMark)
{
if (assemblyFile == null)
throw new ArgumentNullException(nameof(assemblyFile));
Contract.EndContractBlock();
AssemblyName an = new AssemblyName();
an.CodeBase = assemblyFile;
an.SetHashControl(hashValue, hashAlgorithm);
// The stack mark is used for MDA filtering
return InternalLoadAssemblyName(an, securityEvidence, null, ref stackMark, true /*thrownOnFileNotFound*/, forIntrospection, suppressSecurityChecks);
}