/// <summary> /// Initializes a new instance of the <see cref="AssemblyPatcher" /> class. /// </summary> /// <param name="targetAssembly">The target assembly being patched by this instance.</param> /// <param name="implicitImport">The implicit import setting.</param> /// <param name="log"></param> public AssemblyPatcher(AssemblyDefinition targetAssembly, ImplicitImportSetting implicitImport = ImplicitImportSetting.OnlyCompilerGenerated, ILogger log = null) { TargetAssembly = targetAssembly; ImplicitImports = implicitImport; Log = log ?? Serilog.Log.Logger; Log.Information("Created patcher for assembly: {0:l}", targetAssembly.Name); Filter = x => true; var assemblyLocation = typeof (PwVersion).Assembly.Location; Log.Information("Patching the assembly using Patchwork.Attributes to embed some common information."); PatchAssembly(assemblyLocation); //we add the Shared members of the Patchwork.Attributes assembly }
/// <summary> /// Initializes a new instance of the <see cref="AssemblyPatcher" /> class. /// </summary> /// <param name="targetAssembly">The target assembly being patched by this instance.</param> /// <param name="implicitImport">The implicit import setting.</param> /// <param name="log"></param> public AssemblyPatcher(AssemblyDefinition targetAssembly, ImplicitImportSetting implicitImport = ImplicitImportSetting.OnlyCompilerGenerated, ILogger log = null) { TargetAssembly = targetAssembly; ImplicitImports = implicitImport; Log = log ?? Serilog.Log.Logger; Log.Information("Created patcher for assembly: {0:l}", targetAssembly.Name); Filter = x => true; var assemblyLocation = typeof(PwVersion).Assembly.Location; Log.Information("Patching the assembly using Patchwork.Attributes to embed some common information."); PatchAssembly(assemblyLocation); //we add the Shared members of the Patchwork.Attributes assembly }
public AssemblyPatcher(string targetAssemblyPath, ImplicitImportSetting implicitImport = ImplicitImportSetting.OnlyCompilerGenerated, ILogger log = null) : this(AssemblyDefinition.ReadAssembly(targetAssemblyPath), implicitImport, log) { }
/// <summary> /// Constructs a new manifest creator with the given settings. /// </summary> /// <param name="log">A log.</param> /// <param name="implicitImports">How to treat code elements that exist in a patch assembly but aren't decorated with a patching attribute.</param> public ManifestCreator(ILogger log = null, ImplicitImportSetting implicitImports = ImplicitImportSetting.OnlyCompilerGenerated) { ImplicitImports = implicitImports; Log = log ?? Serilog.Log.Logger; }