【问题标题】:Add manually ReportViewer assembly in web.config在 web.config 中手动添加 ReportViewer 程序集
【发布时间】:2017-05-04 18:00:26
【问题描述】:

我正在尝试将 ReportViewer 程序集添加到我的 web.config 文件中。我放置了两个取自该目录的 dll:

  • 来自 C:\Program Files 的 Microsoft.ReportViewer.WebForms.dll (x86)\Microsoft Visual Studio 12.0\ReportViewer

  • 来自 C:\Program Files\Microsoft
    的 Microsoft.reportviewer.common.dll Office\Office15\ADDINS\PowerPivot Excel 插件

但是当我运行我的网页时它显示错误。

Line 14:     <compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
Line 15:      <assemblies>
Line 16:         <add assembly="Microsoft.ReportViewer.WebForms" />
Line 17:         <add assembly="Microsoft.ReportViewer.Common" />
Line 18:       </assemblies>

程序集堆栈跟踪是:

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.ReportViewer.WebForms
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Microsoft.ReportViewer.WebForms | Domain ID: 6
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/Dang/Documents/small/
LOG: Initial PrivatePath = C:\Users\Dang\Documents\small\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\Dang\Documents\small\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vleave/4204733b/f10534fe/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vleave/4204733b/f10534fe/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///C:/Users/Dang/Documents/small/bin/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///C:/Users/Dang/Documents/small/bin/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vleave/4204733b/f10534fe/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/vleave/4204733b/f10534fe/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///C:/Users/Dang/Documents/small/bin/Microsoft.ReportViewer.WebForms.EXE.
LOG: Attempting download of new URL file:///C:/Users/Dang/Documents/small/bin/Microsoft.ReportViewer.WebForms/Microsoft.ReportViewer.WebForms.EXE.

【问题讨论】:

    标签: asp.net reporting-services


    【解决方案1】:

    你的网络配置应该有类似于下面的项目。

        <assemblies>            
                <add assembly="Microsoft.ReportViewer.Common, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
                <add assembly="Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
        </assemblies>
    
     <buildProviders>
            <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
          </buildProviders>
    
     <handlers>
          <add name="ReportViewerWebControlHandler" preCondition="integratedMode" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=14.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
        </handlers>
    
    
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <dependentAssembly>
            <assemblyIdentity name="Microsoft.ReportViewer.WebForms" publicKeyToken="89845dcd8080cc91" culture="neutral" />
            <bindingRedirect oldVersion="0.0.0.0-14.0.0.0" newVersion="14.0.0.0" />
          </dependentAssembly>
        </assemblyBinding>
      </runtime>
    

    The Report Viewer Web Control HTTP Handler has not been registered in the application's web.config file

    【讨论】:

    • 感谢您的回答。现在我收到此错误.. WRN:比较程序集名称导致不匹配:主要版本 ERR:无法完成程序集设置(hr = 0x80131040)。探测终止。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-11-14
    • 1970-01-01
    • 1970-01-01
    • 2011-08-22
    • 2017-02-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多