2012-12-28 315 views
2

运行的更新已发布的应用后,我得到一个错误:装配冲突Microsoft.ReportViewer.WebForms

Parser Error Message: Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. 

源错误:

Line 1: <%@ Page Title="" Language="C#" MasterPageFile="~/XXX/Pages/MainMaster.Master" AutoEventWireup="true" 
Line 2: CodeBehind="Report.aspx.cs" Inherits="xxx.yy.cc.tt.Pages.Reports.Report" %><%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %> 

我还没有更新,为10.0 - >它应该是9.0。它在web.config中是9,而在同一服务器上运行的其他应用程序是9.0。所以我想知道,从哪里可以得到该请求命令来搜索10.0版本?

当我使用Visual Studio 2012进行开发时,我认为它在一些阶段会自动错误地执行它。但是,因为我是初学者,我不知道要在哪里搜索“自动”修改的配置。 Web.config中的

复制粘贴:

<compilation debug="false" defaultLanguage="c#" targetFramework="4.0"> 
     <assemblies> 
      <add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
      <add assembly="Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> 
     </assemblies> 
     <buildProviders> 
      <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> 
     </buildProviders> 
    </compilation> 

    <httpHandlers> 
     <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/> 
    </httpHandlers> 

而且它的怪异,如果我运行相同的版本我更新,它在我的本地机器它的工作原理。

+0

在web.config中可能会指定几个地方。检入buildprovider部分和assembly部分中的编译部分。 – daustin

+0

我使用构建脚本进行更新。我不把web.config复制到服务器。它在更新后开始出现此错误。所以我很确定它必须在别的地方。但检查.. - >不,我只指向9.0版本..:S –

+0

请问你看看我的答案[无法加载文件或程序集'Microsoft.ReportViewer.Common,版本...](http: //stackoverflow.com/questions/22253607/could-not-load-file-or-assembly-microsoft-reportviewer-common-version-11-0-0-0/33670464#33670464)? –

回答

3

遇到类似问题 解决方案: - 在项目上打开引用'Microsoft.ReportViewer.WebForms'的引用标签 - 选择引用 - Microsoft.ReportViewer.WebForms,右键单击并从上下文菜单中选择属性选项。 - 在属性选项卡上确保将复制到本地设置为True。

0

检查这些各款下的配置文件:

<compilation ...> 
     <assemblies> 
     <add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> 
     <add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" /> 
</assemblies> 

    <buildProviders> 
    <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
    </buildProviders> 
</compilation> 
. 
. 
<httpHandlers> 
     <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
     validate="false" /> 
</httpHandlers> 

这可能是指10,但应该是9

+0

nop,都是指9 - 更新我的问题与复制粘贴从web-config –

1

Microsoft.ReportViewer.WebFormsMicrosoft.ReportViewer.Common删除refences组成项目,删除所有的节点从web.config,现在再次添加引用。

编译,它应该是所有好的

+0

基本上,因为它为我工作在本地我只是再次更新 - 工作..不知道是什么产生了错误:S 但感谢:) –

+0

基本上你是在引用一些老的DLL。此过程将重置该过程并重新添加web.config中的条目。如果您认为这是您的问题的答案,请检查大标记。 –

+0

这个答案的问题是,我有数百页使用WebForms DLL(使用Microsoft.Reporting.WebForms;),所以我不能像从项目中删除引用 – AlexFreitas

1

在生产服务器: 1日。安装reportviewer.exe版本10. 2nd。停止并启动用于应用程序的iis中的池。

这些步骤在WS2003和asp.net 4.0

0

我刚才删除的组件的线从web.config文件,它为我工作得很好工作对我来说.... :)

+0

那样重新编译项目这不提供这个问题的答案。要批评或要求作者澄清,在他们的帖子下留下评论 - 你总是可以评论你自己的帖子,一旦你有足够的[声誉](http://stackoverflow.com/help/whats-reputation),你会能够[评论任何帖子](http://stackoverflow.com/help/privileges/comment)。 –

+0

ohh sure ...让我在发布这样不合适的答案之前了解更多...谢谢@SimonMartin :) –