发布后 MVC 找不到依赖项

MVC can't find dependency after publish

我正在尝试从 VS2015 发布一个 MVC 应用程序。

我发布成功了,但是当我尝试 运行 应用程序时,我得到了

Could not load file or assembly 'xxx.DLL' or one of its dependencies. The specified module could not be found.

如果我在远程 IIS 上启用 "enable 32 bit application",我会得到:

Could not load file or assembly 'xxx' or one of its dependencies. An attempt was made to load a program with an incorrect format.

当我在 32 位或其他方式上构建 64 位 dll 时,我通常会遇到此错误。这里不是这种情况。在 64 位上有 64 位 dll 的构建。

我该怎么办?

P.S:我还尝试获取 32 位 DLL,在 32 位上构建并将其部署到 IIS,并将 "enable 32 bit application" 设置为 true,我得到了相同的错误

我会回答我自己的问题。

那个特定的 dll 需要 C++ Redistributable 2010。将它安装在服务器上并且可以运行。