【问题标题】:CefSharp Winform deployment via ClickOnce and requirements vc redist in Visual Studio 2019 - Error通过 ClickOnce 部署 CefSharp Winform 并要求 Visual Studio 2019 中的 vc redist - 错误
【发布时间】:2019-10-27 09:24:28
【问题描述】:

当启动 CefSharp Winform 应用程序的 clickonce 设置时,安装 vc++ 2019 redist 时返回错误(vc++ 在部署要求中)。它在安装过程中生成一个空目录。

“C:\Users\xxxxxx\AppData\Local\Temp\VSD66FC.tmp\vcredist_x86\vcredist_x86.exe 自最初发布以来已更改。”

在 Windows 7 和 10 上,同样的错误。我需要手动安装包。

我已经从需求中删除了 Visual C++“14”,但我不知道如何在应用程序代码中包含 c++ 库。

【问题讨论】:

  • 发帖前你做了哪些研究?快速搜索,我看到很多其他关于此错误的报告,很可能基于提供的有限信息是developercommunity.visualstudio.com/content/problem/570552/…
  • 嗨@amaitland。我用谷歌搜索并到达,但不适合我。更改引导程序包(it 版本)中的链接仍然存在相同的问题(与社区 2019 16.3.6 相比)。我向您展示部分安装日志:(28/10/2019 17:49:06)从 'aka.ms/vs/16/release/14.23.27820/VC_Redist.x86.exe' 下载 'vcredist_x86\vc_redist.x86.exe' 到 'C:\Users\Test\AppData\Local\Temp \VSD6C89.tmp\' 在该目录 ramians (VSD6C89.tmp) 中只有 vcredist_x86\、install.txt 和 setup.exe。正如您可以尝试的那样,链接是正确的......我不明白为什么不工作,我正在寻找解决方法。
  • 我尝试在临时目录中运行 setup.exe 并返回相同的错误。如果我手动运行 VC_redist.x86.exe(从链接下载),它就可以工作......
  • 可能是这个错误? C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(5403,5): 警告 MSB3157: non è stato possibile trovare una corrispondenza con le impostazioni cultura 'it-IT' per l'elemento 'Visual C++ "14" Runtime Libraries (x86)'。 Verranno 使用 le impostazioni cultura 'en'。 bootstrapper 目录下没有 en 包。

标签: c# c++ winforms clickonce cefsharp


【解决方案1】:

我找到了解决方法。我正在使用一项服务,但它应该在 winform 中工作:

 private void InstallVCredist()
    {
        string exe = @"path to exe\VC_redist.x86.exe"; //set path
        string stp = @"\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"; //set subkey
        using (RegistryKey reg = Registry.LocalMachine.OpenSubKey(stp)) //recall registry
        {
            if (reg != null)
            {
                foreach (string dname in reg.GetSubKeyNames()) //loop search
                {
                    using (RegistryKey sreg = reg.OpenSubKey(dname))
                    {
                        if (sreg.GetValue("DisplayName").ToString() == "Microsoft Visual C++ 2015-2019 Redistributable (x86) - 14.23.27820") //set dispayname of version
                        {
                            vcredist = "1"; //it's mine control variable
                            break;
                        }
                    }
                }
            }
        }
        if (vcredist == "0") //now testing if it was found 
        {
            Process vc = new Process();
            vc.StartInfo.FileName = exe;
            //silent install
            vc.StartInfo.Arguments = "/install /passive /norestart";
            vc.StartInfo.UseShellExecute = false;
            vc.StartInfo.CreateNoWindow = true;
            //silent install
            vc.Start(); 
            vc.WaitForExit(); //as he says ;)
        }
    }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-16
    • 2013-09-16
    • 2014-05-15
    • 1970-01-01
    相关资源
    最近更新 更多