winforms 无法创建组件“ReportViewer”,错误消息如下:

oyt4ldly  于 2023-08-07  发布在  其他
关注(0)|答案(2)|浏览(282)

我无法解决此异常消息,请帮助我。
无法创建组件'ReportViewer'
错误消息如下:
'System.InvalidCastException:[A]Microsoft.Reporting.WinForms.ReportViewer无法强制转换为[B] Microsoft.Reporting.WinForms.ReportViewer。
类型A源自“C:\Users\ComputerName\AppData\Local\Microsoft\VisualStudio\16.0_81430e9d\ProjectAssemblies\tmy4po5j01\Microsoft.ReportViewer.WinForms.dll”中上下文中的“LoadNeither”中的“Microsoft.ReportViewer.WinForms,Version=15.0.0.0,Culture=neutral,PublicKeyToken=89845dcd8080cc91”。
类型B源自“C:\PROGRAM FILES(X86)\MICROSOFT VISUAL STUDIO\2019\COMMUNITY\COMMON7\IDE\COMMONEXTENS\MICROSOFT\SSAS\Microsoft.ReportViewer.WinForms.dll”的上下文中的“LoadFrom”中的“Microsoft.ReportViewer.WinForms,Version=15.0.0.0,Culture=neutral,PublicKeyToken=89845dcd8080cc91”。
在Microsoft.Reporting.WinForms.ReportViewerDesigner.get_ActionLists()
at System.ComponentModel.Design.ComponentDesigner.CDDesignerCommandSet.GetCommands(String name)
在System.ComponentModel.Design.DesignerCommandSet.get_ActionLists()
在System.com...'

wi3ka0sx

wi3ka0sx1#

我也遇到了同样的问题,为了解决这个问题,我不得不安装相同版本的Reporting Services和SQL Server Types包。查看图片了解版本详细信息。
Image

bgtovc5b

bgtovc5b2#

我在更新nuget包后也遇到了同样的问题。如果我构建解决方案,报告仍然有效。我不能在Visual Studio中编辑它们,然后我在设计器中得到这个错误。

相关问题