10

しばらくの間、Web サイトで MS ReportViewer コンポーネントを使用していますが、最近、以下に示すエラーが表示されます。

パーサー エラー メッセージ: 基本クラスにはフィールド 'xyz' が含まれていますが、その型 (Microsoft.Reporting.WebForms.ReportViewer) はコントロールの型 (Microsoft.Reporting.WebForms.ReportViewer) と互換性がありません。

<rsweb:ReportViewer ID="xyz" runat="server" Width="100%" Font-Names="Verdana" Font-Size="8pt" Height="400px" ProcessingMode="Local" ShowExportControls="false">

現在、Visual Studio と運用環境でこのエラーが発生します。ReportViewer Redistributable を本番環境にインストールしています。

私のプロジェクトで何らかの参照が欠落していますか?

4

8 に答える 8

6

私は答えを発見しました:どういうわけかMicrosoft.Reporting.WebFormsのバージョン9への参照がバージョン8に切り替えられました。これがエラーの原因でした。したがって、参照を削除して正しいバージョンの参照を追加すると、問題が修正されたようです。

編集:

以前のバージョンの.vbprojファイルによると、プロジェクト参照プロパティ画面に8と表示されていたにもかかわらず、9への参照でした。要するに、何が失敗したのかはよくわかりませんが、今働いています。

誰かがこれを経験したか、何らかの洞察を持っているなら、貢献してください。

于 2009-05-04T14:49:55.953 に答える
2

\bin ファイルから削除する必要がある場合もあります。

     Microsoft.ReportViewer.Common.dll
     Microsoft.ReportViewer.ProcessingObjectModel.dll
     Microsoft.ReportViewer.WebForms.dll
     Microsoft.ReportViewer.WinForms.dll

それらをサブディレクトリに移動しました。

于 2012-07-24T15:39:29.530 に答える
2

クリーン インストールの後、dll への参照が壊れていたため、プロジェクトがコンパイルされませんでした。そのため、dll を削除して再度追加すると、ReportViewer が使用されている Web ページでパーサー エラーが発生しました。

The base class includes the field 'rprtReportsViewer', but its type (Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.WebForms.ReportViewer).

追加したばかりのバージョン番号とは異なるバージョン番号の参照を Web ページで見つけました。

<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>

バージョンを 9.0.0.0 に変更したところ、今度はページを更新したときにコンパイラ エラーが発生しました。

CS0433: The type 'Microsoft.Reporting.WebForms.ReportViewer' exists in both 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\8.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll' and 'c:\Windows\assembly\GAC_MSIL\Microsoft.ReportViewer.WebForms\9.0.0.0__b03f5f7f11d50a3a\Microsoft.ReportViewer.WebForms.dll'

次に、「Microsoft.ReportViewer」のソリューションを検索し、compilation.config でさらに参照を見つけました。

    <add assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
    <add assembly="Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
  </assemblies>
  <buildProviders>
    <add extension=".rdlc" type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </buildProviders>

ここでもバージョン番号を変更し、エラーを停止しました

于 2011-03-31T10:20:20.740 に答える
0

Having the same issue. Clean Windows 2008 Server install with SQL Server 2005 and SQL Reporting. The server hosts the site. Installed ReportViewer 2008 SP1. Web.config references version 9.0.0.0.

The same error message comes up: The base class includes the field but its type (Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.WebForms.ReportViewer).

Searched online and lots of people experience the same issue. Some people suggest manually editing project file. I managed to fix it by setting Specific Version = True (Version=9.0.0.0) in the Solution Explorer->[Web Project Name]->References->Microsoft.Reporting.WebForms->Properties.

In one of the environments we also found Microsoft.Reporting dlls in the web bin folder. And, they were conflicting with the dlls registered in the GAC. Deleting of the dlls solved the issue.

于 2009-07-10T17:23:25.683 に答える
-2

同じエラーに遭遇しました。私にとってうまくいったのは、参照 Microsoft.ReportViewer.WebForms を削除して再度追加することでした。

于 2016-11-07T10:01:24.557 に答える