C# 无法加载文件或程序集 CrystalDecisions.ReportAppServer.ClientDoc

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10001310/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-09 12:05:22  来源:igfitidea点击:

Could not load file or assembly CrystalDecisions.ReportAppServer.ClientDoc

c#asp.net-mvccrystal-reports

提问by Jeremy Holovacs

I've looked at similar questions on SO, but nothing quite matches my issue as far as I can tell.

我看过关于 SO 的类似问题,但据我所知,没有什么与我的问题完全相符。

The exception message:

异常信息:

Could not load file or assembly 'CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified.

无法加载文件或程序集“CrystalDecisions.ReportAppServer.ClientDoc,版本=13.0.2000.0,Culture=neutral,PublicKeyToken=692fbea5521e1304”或其依赖项之一。该系统找不到指定的文件。

The file is in my GAC. I am developing on a 32 bit machine (Windows 7) running VS2010, everything is .NET4. The target hosting machine is 64-bit Win 2008 R2. My local machine has the CR installation for VS2010; the hosting machine has the 64-bit runtimes for VS2010. I am compiling all my code in "Any CPU" mode for this web application.

该文件在我的 GAC 中。我正在运行 VS2010 的 32 位机器(Windows 7)上开发,一切都是 .NET4。目标主机是 64 位 Win 2008 R2。我的本地机器有VS2010的CR安装;主机具有 VS2010 的 64 位运行时。我正在为此 Web 应用程序以“任何 CPU”模式编译我的所有代码。

It is blowing my mind that it cannot find the file in the GAC. This is an IIS application; is there some sort of permissions issue? I would think IIS would have access to the GAC.

它在 GAC 中找不到该文件,这让我大吃一惊。这是一个 IIS 应用程序;是否存在某种权限问题?我认为 IIS 可以访问 GAC。

Some suggestions of what to do would be appreciated.

一些关于做什么的建议将不胜感激。

采纳答案by Jeremy Holovacs

It turns out the answer was ridiculously simple, but mystifying as to why it was necessary.

事实证明,答案简单得可笑,但为什么需要这样做却令人费解。

In the IIS Manager on the server, I set the application pool for my web application to not allow 32-bit assemblies.

在服务器上的 IIS 管理器中,我将 Web 应用程序的应用程序池设置为不允许 32 位程序集。

It seems it assumes, on a 64-bit system, that you must want the 32 bit assembly. Bizarre.

似乎假设在 64 位系统上,您必须需要 32 位程序集。奇怪。

回答by Micah Armantrout

回答by Dylan - INNO Software

Regarding the 64-bit system wanting 32-bit support. I don't find it so bizarre:

关于需要 32 位支持的 64 位系统。我不觉得奇怪:

Although deployed to a 64-bit system, this doesn't mean all the referenced assemblies are necessarily 64-bit Crystal Reports assemblies. Further to that, the Crystal Reports assemblies are largely just wrappers to a collection of legacy DLLs upon which they are based. Many 32-bit DLLs are required by the primarily referenced assembly. The error message "can not load the assembly" involves these DLLs as well. To see visually what those are, go to www.dependencywalker.com and run 'Depends' on the assembly in question, directly on that IIS server.

尽管部署到 64 位系统,但这并不意味着所有引用的程序集都必须是 64 位 Crystal Reports 程序集。此外,Crystal Reports 程序集在很大程度上只是它们所基于的遗留 DLL 集合的包装器。主要引用的程序集需要许多 32 位 DLL。错误消息“无法加载程序集”也涉及这些 DLL。要直观地查看它们是什么,请访问 www.dependencywalker.com 并直接在该 IIS 服务器上对相关程序集运行“Depends”。

回答by ZahidKakar

You simply need to install Crystal Report Report Run Timedownloads on Deployment Server. If problem still appears, then place check asp_client folder in your project main folder.

您只需要在 Deployment Server 上安装Crystal Report Report Run Time下载。如果问题仍然出现,则将检查 asp_client 文件夹放在您的项目主文件夹中。