IBM.Data.DB2 FileNotFound Loading Microsoft.ReportingService



我有一个 ASP.Net 应用程序,它引用了一个带有一些可重用代码(通用实用程序、数据访问等)的程序集。程序集引用IBM.Data.DB2.dll 。但是,我没有在我的应用程序中使用 DB2,IBM.Data.DB2.dll只是一个依赖项(以防应用程序需要连接到 DB2)。最近,我遇到了以下错误:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.ReportingServices.Interfaces, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.ReportingServices.Interfaces, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
  at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
  at System.Reflection.RuntimeModule.GetTypes()
  at System.Reflection.Assembly.GetTypes()
  at Unity.AutoRegistration.AutoRegistration.<ApplyAutoRegistration>b__5(Assembly a)
  at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
  at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
  at Unity.AutoRegistration.AutoRegistration.ApplyAutoRegistration()

整个应用程序中唯一包含 Microsoft.ReportingServices.Interfaces 的文件是 IBM.Data.DB2.dll 文件。我不需要 SQL Server,也不需要本地安装 SQL Server 的开销,更不用说在部署应用程序时在服务器上的开销了。请记住,我需要使用依赖于IBM.Data.DB2.dll的程序集,并且此错误过去没有发生过,似乎是最近的。

我尝试过绑定重定向,通过Nuget安装Microsoft.ReportingServices.Interfaces都无济于事。

有谁知道为什么会发生此错误,更重要的是....如何解决?

如果IBM.Data.DB2.dll引用Microsoft.ReportingServices.Interfaces,您可能需要手动将Microsoft.ReportingServices.Interfaces.dll复制到bin文件夹中。 这里有一篇可以帮助您的帖子:

Microsoft.ReportingServices.Interfaces.dll在 SSRS 2005 中缺失

最新更新