本文整理汇总了C#中Microsoft.CodeAnalysis.AssemblyIdentity.ToAssemblyName方法的典型用法代码示例。如果您正苦于以下问题:C# AssemblyIdentity.ToAssemblyName方法的具体用法?C# AssemblyIdentity.ToAssemblyName怎么用?C# AssemblyIdentity.ToAssemblyName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.AssemblyIdentity
的用法示例。
在下文中一共展示了AssemblyIdentity.ToAssemblyName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Load
/// <summary>
/// Loads assembly with given identity.
/// </summary>
/// <param name="identity">The assembly identity.</param>
/// <param name="location">Location of the assembly.</param>
/// <returns>Loaded assembly.</returns>
public override Assembly Load(AssemblyIdentity identity, string location = null)
{
if (!string.IsNullOrEmpty(location))
{
RegisterDependency(identity, location);
}
// Don't let the CLR load the assembly from the CodeBase (location),
// which uses LoadFrom semantics (we want LoadFile):
return Assembly.Load(identity.ToAssemblyName());
}
示例2: CreateDynamicModule
private static ModuleBuilder CreateDynamicModule(AssemblyBuilderAccess access, AssemblyIdentity name, string fileName)
{
var assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly(name.ToAssemblyName(), access);
if (DisableJitOptimizations)
{
assemblyBuilder.SetCustomAttribute(new CustomAttributeBuilder(
typeof(DebuggableAttribute).GetConstructor(new[] { typeof(DebuggableAttribute.DebuggingModes) }),
new object[] { DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations }));
}
const string moduleName = "InteractiveModule";
if (access == AssemblyBuilderAccess.RunAndSave)
{
return assemblyBuilder.DefineDynamicModule(moduleName, fileName, emitSymbolInfo: false);
}
else
{
return assemblyBuilder.DefineDynamicModule(moduleName, emitSymbolInfo: false);
}
}
示例3: Load
public override Assembly Load(AssemblyIdentity identity, string location = null)
{
return Assembly.Load(identity.ToAssemblyName());
}