I've been using a MS ReportViewer component in a website for a while now, but recently I've been getting the error shown below.
我一直在网站上使用MS ReportViewer组件一段时间了,但最近我收到了如下所示的错误。
Parser Error Message: The base class includes the field 'xyz', but its type (Microsoft.Reporting.WebForms.ReportViewer) is not compatible with the type of control (Microsoft.Reporting.WebForms.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">
Now, I get this error in Visual Studio as well as in production. I have the ReportViewer Redistributable installed in production.
现在,我在Visual Studio和生产中都遇到了这个错误。我在生产中安装了ReportViewer Redistributable。
Am I somehow missing a reference in my project, or something?
我在某种程度上错过了我的项目中的参考,或者其他什么?
8 个解决方案
#1
6
I discovered the answer: Somehow the reference to version 9 of Microsoft.Reporting.WebForms got switched to version 8. This caused the error. So deleting the reference and adding in the correct version of the reference seems to have fixed the problem.
我发现了答案:不知何故,对Microsoft.Reporting.WebForms版本9的引用已切换到版本8.这导致了错误。所以删除引用并添加正确的引用版本似乎已经解决了问题。
Edit:
编辑:
Well, according to the previous version of the .vbproj file, it was a reference to 9, despite that the project references properties screen told me 8. In short I'm not really sure what managed to get screwed up, but it seems to be working now.
好吧,根据.vbproj文件的先前版本,它是对9的引用,尽管项目引用属性屏幕告诉我8.简而言之,我不确定是什么设法搞砸了,但它似乎现在正在工作。
If anyone has experienced this or has some insight, please contribute.
如果有人经历过这个或有一些见解,请提供帮助。
#2
2
Following a clean install, my project didn't compile because the reference to the dll was broken, so I deleted it and added it again, then the web page where the ReportViewer is used gave a parser error:
在干净安装之后,我的项目没有编译,因为对dll的引用被破坏了,所以我删除它并再次添加它,然后使用ReportViewer的网页给出了一个解析器错误:
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).
基类包括字段'rprtReportsViewer',但其类型(Microsoft.Reporting.WebForms.ReportViewer)与控件类型(Microsoft.Reporting.WebForms.ReportViewer)不兼容。
I found a reference on the webpage with version number different to the one I had just added:
我在网页上找到了一个引用,其版本号与我刚刚添加的版本号不同:
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
I changed the version to 9.0.0.0, and this time got a compiler error when I refreshed the page:
我将版本更改为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'
I then searched the solution for "Microsoft.ReportViewer" and found more references in compilation.config:
然后我搜索了“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>
I changed the version numbers here too and it stopped the errors
我也在这里更改了版本号,它停止了错误
#3
2
You may also need to Remove from \bin files:
您可能还需要从\ bin文件中删除:
Microsoft.ReportViewer.Common.dll
Microsoft.ReportViewer.ProcessingObjectModel.dll
Microsoft.ReportViewer.WebForms.dll
Microsoft.ReportViewer.WinForms.dll
I just moved them into a sub directory.
我只是将它们移动到子目录中。
#4
2
Check your page rdlc version like
检查您的页面rdlc版本
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
#5
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.
有同样的问题。使用SQL Server 2005和SQL Reporting清理Windows 2008 Server安装。服务器托管该站点。安装了ReportViewer 2008 SP1。 Web.config引用版本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).
出现相同的错误消息:基类包括字段但其类型(Microsoft.Reporting.WebForms.ReportViewer)与控件类型(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.
在线搜索,很多人都遇到了同样的问题。有人建议手动编辑项目文件。我设法通过在解决方案资源管理器 - > [Web项目名称] - >引用 - > Microsoft.Reporting.WebForms->属性中设置特定版本= True(版本= 9.0.0.0)来修复它。
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.
在其中一个环境中,我们还发现了Microsoft.Reporting dll在web bin文件夹中。而且,它们与GAC中注册的dll相冲突。删除dll解决了这个问题。
#6
0
I had this problem on a Production server. I installed the correct version of ReportViewer and made sure all the references in the project were pointing at the correct version. However, I was still getting errors.
我在生产服务器上遇到此问题。我安装了正确版本的ReportViewer,并确保项目中的所有引用都指向正确的版本。但是,我仍然遇到错误。
Eventually I solved the problem by going to 'Temporary ASP.NET Files' and deleting the files for my app. To do this you'll need to stop the app first. This then solved the problem. On DEV servers I had not encountered this problem because after installing ReportViewer I re-started the machine.
最终我通过转到“临时ASP.NET文件”并删除我的应用程序的文件来解决问题。要执行此操作,您需要先停止应用程序。这就解决了这个问题。在DEV服务器上我没有遇到这个问题,因为在安装ReportViewer之后我重新启动了这台机器。
Hope this helps someone. I pulled a lot of hair out before I solved this particular 'challenge'.
希望这有助于某人。在我解决这个特殊的“挑战”之前,我拉了很多头发。
#7
0
References -> (Microsoft.ReportViewer.WebForms), click the right mouse button.
引用 - >(Microsoft.ReportViewer.WebForms),单击鼠标右键。
The Specify Version option, leave it as false.
“指定版本”选项,将其保留为false。
After that, just save and run again.
之后,只需保存并再次运行。
#8
-2
I came across the same error. What worked for me was to delete the reference Microsoft.ReportViewer.WebForms and add it again.
我遇到了同样的错误。对我有用的是删除引用Microsoft.ReportViewer.WebForms并再次添加它。
#1
6
I discovered the answer: Somehow the reference to version 9 of Microsoft.Reporting.WebForms got switched to version 8. This caused the error. So deleting the reference and adding in the correct version of the reference seems to have fixed the problem.
我发现了答案:不知何故,对Microsoft.Reporting.WebForms版本9的引用已切换到版本8.这导致了错误。所以删除引用并添加正确的引用版本似乎已经解决了问题。
Edit:
编辑:
Well, according to the previous version of the .vbproj file, it was a reference to 9, despite that the project references properties screen told me 8. In short I'm not really sure what managed to get screwed up, but it seems to be working now.
好吧,根据.vbproj文件的先前版本,它是对9的引用,尽管项目引用属性屏幕告诉我8.简而言之,我不确定是什么设法搞砸了,但它似乎现在正在工作。
If anyone has experienced this or has some insight, please contribute.
如果有人经历过这个或有一些见解,请提供帮助。
#2
2
Following a clean install, my project didn't compile because the reference to the dll was broken, so I deleted it and added it again, then the web page where the ReportViewer is used gave a parser error:
在干净安装之后,我的项目没有编译,因为对dll的引用被破坏了,所以我删除它并再次添加它,然后使用ReportViewer的网页给出了一个解析器错误:
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).
基类包括字段'rprtReportsViewer',但其类型(Microsoft.Reporting.WebForms.ReportViewer)与控件类型(Microsoft.Reporting.WebForms.ReportViewer)不兼容。
I found a reference on the webpage with version number different to the one I had just added:
我在网页上找到了一个引用,其版本号与我刚刚添加的版本号不同:
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
I changed the version to 9.0.0.0, and this time got a compiler error when I refreshed the page:
我将版本更改为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'
I then searched the solution for "Microsoft.ReportViewer" and found more references in compilation.config:
然后我搜索了“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>
I changed the version numbers here too and it stopped the errors
我也在这里更改了版本号,它停止了错误
#3
2
You may also need to Remove from \bin files:
您可能还需要从\ bin文件中删除:
Microsoft.ReportViewer.Common.dll
Microsoft.ReportViewer.ProcessingObjectModel.dll
Microsoft.ReportViewer.WebForms.dll
Microsoft.ReportViewer.WinForms.dll
I just moved them into a sub directory.
我只是将它们移动到子目录中。
#4
2
Check your page rdlc version like
检查您的页面rdlc版本
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
#5
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.
有同样的问题。使用SQL Server 2005和SQL Reporting清理Windows 2008 Server安装。服务器托管该站点。安装了ReportViewer 2008 SP1。 Web.config引用版本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).
出现相同的错误消息:基类包括字段但其类型(Microsoft.Reporting.WebForms.ReportViewer)与控件类型(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.
在线搜索,很多人都遇到了同样的问题。有人建议手动编辑项目文件。我设法通过在解决方案资源管理器 - > [Web项目名称] - >引用 - > Microsoft.Reporting.WebForms->属性中设置特定版本= True(版本= 9.0.0.0)来修复它。
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.
在其中一个环境中,我们还发现了Microsoft.Reporting dll在web bin文件夹中。而且,它们与GAC中注册的dll相冲突。删除dll解决了这个问题。
#6
0
I had this problem on a Production server. I installed the correct version of ReportViewer and made sure all the references in the project were pointing at the correct version. However, I was still getting errors.
我在生产服务器上遇到此问题。我安装了正确版本的ReportViewer,并确保项目中的所有引用都指向正确的版本。但是,我仍然遇到错误。
Eventually I solved the problem by going to 'Temporary ASP.NET Files' and deleting the files for my app. To do this you'll need to stop the app first. This then solved the problem. On DEV servers I had not encountered this problem because after installing ReportViewer I re-started the machine.
最终我通过转到“临时ASP.NET文件”并删除我的应用程序的文件来解决问题。要执行此操作,您需要先停止应用程序。这就解决了这个问题。在DEV服务器上我没有遇到这个问题,因为在安装ReportViewer之后我重新启动了这台机器。
Hope this helps someone. I pulled a lot of hair out before I solved this particular 'challenge'.
希望这有助于某人。在我解决这个特殊的“挑战”之前,我拉了很多头发。
#7
0
References -> (Microsoft.ReportViewer.WebForms), click the right mouse button.
引用 - >(Microsoft.ReportViewer.WebForms),单击鼠标右键。
The Specify Version option, leave it as false.
“指定版本”选项,将其保留为false。
After that, just save and run again.
之后,只需保存并再次运行。
#8
-2
I came across the same error. What worked for me was to delete the reference Microsoft.ReportViewer.WebForms and add it again.
我遇到了同样的错误。对我有用的是删除引用Microsoft.ReportViewer.WebForms并再次添加它。