示例#1
0
        static int Main(string[] args)
        {
            try
            {
                if (args.Length != 1)
                {
                    Console.WriteLine($"{typeof(Program).GetTypeInfo().Assembly.GetName().Name} file_path is expecting one file argument");
                    return(1);
                }

                var file    = args[0];
                var program = new InteropApp
                {
                    GlobalNamespace = "SharpDX",
                    Logger          = new Logger()
                };
                program.PatchFile(file);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                return(1);
            }
            return(0);
        }
示例#2
0
 public override bool Execute()
 {
     BindingRedirectResolution.Enable();
     try
     {
         var patchApp = new InteropApp
         {
             AssemblyResolver = new MSBuildAssemblyResolver(References),
             Logger           = new MSBuildSharpPatchLogger(Log),
         };
         patchApp.PatchFile(AssemblyToPatch);
         return(true);
     }
     catch (Exception ex)
     {
         Log.LogErrorFromException(ex, true, true, null);
         return(false);
     }
 }