Azure Web App - 无法加载文件或程序集Microsoft.SqlServer.Types

时间:2017-11-29 17:57:26

标签: azure reporting-services azure-web-sites

我有几个Azure Web Apps使用MS Report Viewer从RDLC文件生成PDF。

两天前,这些工作正常。

此后没有任何应用程序被更改,但现在所有应用程序都无法生成PDF,并出现以下错误:

Could not load file or assembly 'Microsoft.SqlServer.Types, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.

YSOD上的堆栈跟踪如下所示:

[FileNotFoundException: Could not load file or assembly 'Microsoft.SqlServer.Types, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.]
   Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.Write(Object obj, Boolean verify, Boolean assertOnInvalidType) +0
   Microsoft.ReportingServices.ReportIntermediateFormat.Persistence.IntermediateFormatWriter.WriteVariantOrPersistable(Object obj) +73
   Microsoft.ReportingServices.ReportPublishing.ReportPublishing.CreateHashForCachedDataSets() +272
   Microsoft.ReportingServices.ReportPublishing.ReportPublishing.InternalCreateIntermediateFormat(Stream definitionStream, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash) +92
   Microsoft.ReportingServices.ReportPublishing.ReportPublishing.CreateIntermediateFormat(Byte[] definition, String& description, String& language, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash) +82
   Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CompileOdpReport(PublishingContext reportPublishingContext, IDataProtection dataProtection, PublishingErrorContext errorContext, String& reportDescription, String& reportLanguage, ParameterInfoCollection& parameters, DataSourceInfoCollection& dataSources, DataSetInfoCollection& sharedDataSetReferences, UserLocationFlags& userReferenceLocation, ArrayList& dataSetsName, Boolean& hasExternalImages, Boolean& hasHyperlinks, Byte[]& dataSetsHash) +165
   Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext, IDataProtection dataProtection) +189

[ReportProcessingException: An unexpected error occurred in Report Processing.]
   Microsoft.ReportingServices.ReportProcessing.ReportProcessing.CreateIntermediateFormat(PublishingContext reportPublishingContext, IDataProtection dataProtection) +989
   Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot) +203

[DefinitionInvalidException: The definition of the report '' is invalid.]
   Microsoft.Reporting.ReportCompiler.CompileReport(ICatalogItemContext context, Byte[] reportDefinition, Boolean generateExpressionHostWithRefusedPermissions, ControlSnapshot& snapshot) +269
   Microsoft.Reporting.LocalService.GetCompiledReport(PreviewItemContext itemContext, Boolean rebuild, ControlSnapshot& snapshot) +228
   Microsoft.Reporting.LocalService.CompileReport() +29
   Microsoft.Reporting.LocalService.Microsoft.Reporting.ILocalProcessingHost.CompileReport() +5
   Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession() +61

[LocalProcessingException: An error occurred during local report processing.]
   Microsoft.Reporting.WebForms.LocalReport.EnsureExecutionSession() +150
   Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings) +83
   Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings) +119
   Microsoft.Reporting.WebForms.LocalReport.Render(String format, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings) +31
   Microsoft.Reporting.WebForms.Report.Render(String format) +71

所有其他功能似乎都很好 - 只是PDF生成失败了。

这怎么可能全面停止工作? Azure有何变化?

3 个答案:

答案 0 :(得分:3)

我们遇到了同样的问题,最终安装了来自nuget的软件包以解决问题

答案 1 :(得分:1)

我的网络应用程序使用实体框架和SQL坐标时遇到了同样的问题。一切正常,直到2017年12月1日,然后我们得到了同样的错误。我以前在我们的web.config中有一个绑定重定向,用于重定向到v13的Microsoft.SqlServer.Types。我更新它指向v14:

  <dependentAssembly>
    <assemblyIdentity name="Microsoft.SqlServer.Types" publicKeyToken="89845dcd8080cc91" culture="neutral" />
    <bindingRedirect oldVersion="10.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
  </dependentAssembly>

我还添加了nuget包是安全的,但我想我不需要。  我猜测v13在azure中更新为v14。

注意:我按照要添加到全局asax文件的nuget包readme说明:SqlServerTypes.Utilities.LoadNativeAssemblies(Server.MapPath(&#34;〜/ bin&#34) ;));

编辑:我确认我不需要添加nuget包。相反,我的决心是调整web.config中的绑定重定向以指向版本14.0.0.0

答案 2 :(得分:0)

昨天(2017年11月29日)面临同样的问题,我们所有的Azure环境都开始报告相同的问题。 Murakri建议修复它确实

很高兴知道到底发生了什么?