Web服务错误,“无法加载文件或程序集'CrystalDecisions.CrystalReports.Engine'

时间:2021-09-23 16:39:56

I can't seem to find any similar topics online regarding this, so apologies for the apparently elementary question...

我似乎无法在网上找到任何类似的主题,所以对显然基本的问题表示道歉......

I foolishly added a crystal report to a test form within a test project inside of a production Visual Studio solution file. I did my tests, and deleted the crystal report from the project.

我愚蠢地将一个水晶报告添加到生产Visual Studio解决方案文件中的测试项目中的测试表单中。我做了我的测试,并从项目中删除了水晶报告。

Part of the solution is a webservice, which was working fine before I published a new version (since I added and removed the crystal report). Now it errors in the live environment:

部分解决方案是Web服务,在我发布新版本之前工作正常(因为我添加并删除了水晶报告)。现在它在实时环境中出错了:

    Could not load file or assembly 'CrystalDecisions.CrystalReports.Engine'

There is no reference to crystal reports in the solution at all (that I can find).

根本没有提到解决方案中的水晶报告(我可以找到)。

References for the Webservice project (contained withing the global solution): Web服务错误,“无法加载文件或程序集'CrystalDecisions.CrystalReports.Engine'

Webservice项目的参考(包含全局解决方案):

To keep the question size down I won't post the web.config file, but if you want it, let me know.

为了保持问题的大小,我不会发布web.config文件,但如果你想要它,请告诉我。

What on earth is going on? and why does my webservice require crystal reports on my webserver when it had absolutely nothing to do with this project!?

到底是怎么回事?为什么我的网络服务在我的网络服务器上需要水晶报告时才与这个项目完全无关!

1 个解决方案

#1


1  

It turns out that i'd missed a few references to crystal reports in my main website project. Not that i'd have expected that to have affected my webservice (totally seperate project within the same solution), but it obviously did.

事实证明,我在主网站项目中错过了一些对水晶报告的引用。并不是说我已经预料到会影响我的网络服务(在同一个解决方案中完全独立的项目),但显然这样做了。

Mystery solved.

谜团已揭开。

edit:

编辑:

At the risk of sounding stupid, i feel its worth noting that my webservice is being hosted in a subdirectory within the IIS virtual directory that hosts the main site. IIS obviously loads the web.config file from the parent directory, during the load of any sub-sites/services. This was a new discovery for me.

冒着愚蠢的风险,我觉得值得注意的是我的webservice被托管在承载主站点的IIS虚拟目录中的子目录中。在加载任何子站点/服务期间,IIS显然会从父目录加载web.config文件。这对我来说是一个新发现。

#1


1  

It turns out that i'd missed a few references to crystal reports in my main website project. Not that i'd have expected that to have affected my webservice (totally seperate project within the same solution), but it obviously did.

事实证明,我在主网站项目中错过了一些对水晶报告的引用。并不是说我已经预料到会影响我的网络服务(在同一个解决方案中完全独立的项目),但显然这样做了。

Mystery solved.

谜团已揭开。

edit:

编辑:

At the risk of sounding stupid, i feel its worth noting that my webservice is being hosted in a subdirectory within the IIS virtual directory that hosts the main site. IIS obviously loads the web.config file from the parent directory, during the load of any sub-sites/services. This was a new discovery for me.

冒着愚蠢的风险,我觉得值得注意的是我的webservice被托管在承载主站点的IIS虚拟目录中的子目录中。在加载任何子站点/服务期间,IIS显然会从父目录加载web.config文件。这对我来说是一个新发现。