在部署为x86和x64的文件时,未找到vcruntime140.dll

时间:2016-04-14 14:52:29

标签: c# dll native vcredist

目前我收到错误消息,在客户端计算机上找不到vcruntime140.dll。但我正在为x64x86提供以下dll:

  1. vcruntime140.dll
  2. vccorlib140.dll
  3. msvcp140.dll
  4. concrt140.dll
  5. \bin32\\bin64\目录中(对于每个平台)。此目录在应用程序启动时注册:

    DLL的导入

    [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
    static extern bool SetDllDirectory(string lpPathName);
    
    [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
    static extern bool AddDllDirectory(string lpPathName);
    

    x86注册码:

    if (System.Environment.OSVersion.Version.Major > 5)
    {
        AddDllDirectory(System.Windows.Forms.Application.StartupPath + "\\bin32");
    }
    else
    {
        SetDllDirectory(System.Windows.Forms.Application.StartupPath + "\\bin32");
    }
    

    我还需要做什么?

    谢谢大家!

0 个答案:

没有答案