示例#1
0
        private static void ApplyDevenvWorkaround(string devenv)
        {
            // Workaround VisualStudio 2012+
            //
            // Correção para permitir ao VisualStudio 2017 compilar projetos do tipo
            // Setup na linha de comando.
            //
            // Leia mais no comentário sobre o Workaround no início do arquivo.

            var folder     = Path.GetDirectoryName(devenv);
            var workaround = Path.Combine(folder,
                                          @"CommonExtensions\Microsoft\VSI\DisableOutOfProcBuild\DisableOutOfProcBuild.exe"
                                          );

            if (File.Exists(workaround))
            {
                Prompt.PrintInfo(
                    "Aplicando um workaround para evitar o erro: HRESULT = '8000000A'\n"
                    );

                using (workaround.GetDir().ChDir())
                {
                    var ok = workaround.Quote().Run();
                    if (!ok)
                    {
                        Prompt.PrintWarn("Falhou a aplicação do workaround.");
                    }
                }
            }
        }
示例#2
0
 private ICommand CreateCommand(TypeInfo type)
 {
     try
     {
         var command = (ICommand)Activator.CreateInstance(type);
         return(command);
     }
     catch (Exception ex)
     {
         Prompt.PrintWarn(ex, $"Não foi possível instanciar o comando: {type.FullName}");
         return(null);
     }
 }