Winforms无法在VS2012中加载文件或程序集'Microsoft.ReportDesigner,Version = 10.0.0.0' [英] Winforms Could not load file or assembly 'Microsoft.ReportDesigner, Version=10.0.0.0' in VS2012

查看:112
本文介绍了Winforms无法在VS2012中加载文件或程序集'Microsoft.ReportDesigner,Version = 10.0.0.0'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这真让我发疯.我在VS2012中有一个针对.NET 4.5的Winforms应用程序构建.在某些表格上,我必须使用ReportViewer.最初,我使用2012年的ReportViewer(版本11.0.0.0).一切正常.但是,我的客户端仍不想在其工作站上安装此版本,因为该版本使用CLR Types SQL2012.不要问我为什么,但是我现在必须接受.

This is driving me nuts. I have a winforms app build in VS2012 targeting .NET 4.5. On a few forms I have to use a ReportViewer. At first I worked with ReportViewer for 2012 (version 11.0.0.0). All working fine. However, my client doesn't want to install this version on their workstations yet because this version uses the CLR Types SQL 2012. Don't ask me why, but I have to accept this for now.

因此,我决定使用以前的reportviewer版本10.0.0.0.我下载了重新分发的软件包并安装了它.我还将它添加到VS2012中的工具箱中,并删除了我的项目中已引用的reportviewer dll.但是,当我在窗体上拖动版本10 Reportviewer时,出现以下错误:

So I decided to use the previous reportviewer version 10.0.0.0. I downloaded the redistributional package and installed it. I also added it to my toolbox in VS2012 and deleted the reportviewer dll's already referenced in my project. But when I drag a version 10 reportviewer on my form I get the following error:

无法加载文件或程序集"Microsoft.ReportDesigner,版本= 10.0.0.0,区域性=中性,PublicKeyToken = b03f5f7f11d50a3a"或其依赖项之一.找到的程序集的清单定义与程序集引用不匹配.(来自HRESULT的异常:0x80131040)

Could not load file or assembly 'Microsoft.ReportDesigner, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

应用程序正在运行,没有错误,但是使用该reportviewer控件的表单在设计时不提供支持,如您在图像中所看到的.我想摆脱错误.

The application IS running without errors, but I have no design-time support on the forms using this reportviewer control, as you can see in the image. I would like to get rid of the error.

我检查了GAC,但找不到提到的Microsoft.ReportDesigner.它适用于9.0.0.0和11.0.0.0版本,但不适用于10.0.0.0.

I checked the GAC and could not find the mentioned Microsoft.ReportDesigner. It is there for version 9.0.0.0 and 11.0.0.0 but not for 10.0.0.0.

最重要的是,如何在VS2012中的设计时使用ReportViewer 10.0.0.0版而不会出现设计时错误的问题?

Bottom line, how can I use the ReportViewer version 10.0.0.0 in design time in VS2012 without the problem of the design-time error?

框架:.NET 4.5应用类型:winforms语言:vb.netVisual Studio:版本2012控制:ReportViewer 10.0.0.0 SP 1

Framework: .NET 4.5 App Type : winforms Language : vb.net Visual Studio: Version 2012 Control: ReportViewer 10.0.0.0 SP 1

P.S.我还在VS2010中测试了ReportViewer控件,在VS2010的设计时使用它没有问题.

P.S. I also tested the ReportViewer control in VS2010, there is no problem using it in design time in VS2010.

[更新]

当我尝试在VS2012中的窗体上添加ReportViewer时的确切错误是:

The exact error when I try to add the ReportViewer on my form in VS2012 is:

推荐答案

我遇到了同样的问题.我可以通过以下解决方法来修复VS 2012设计器.我怀疑这是正确的方法,但是它会有所帮助,我暂时没有发现任何更好的方法.

I had the same problem. I was able to fix VS 2012 designer with the following workaround. I doubt this is the correct way, but it helps and I did not find anything better for now.

  1. 关闭Visual Studio 2012

  1. Close Visual Studio 2012

转到C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ Common7 \ IDE \ PrivateAssemblies文件夹,然后复制所有报表查看器程序集(文件名以"Microsoft.ReportDesigner ..开头",版本为10.0)..0.0)到C:\ Program Files(x86)\ Microsoft Visual Studio 11.0 \ Common7 \ IDE \ PrivateAssemblies.备份它,然后再执行此操作.

Go to C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies folder and copy all report viewer assemblies (file names are starting with "Microsoft.ReportDesigner." and version is 10.0.0.0) to the C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\PrivateAssemblies. Backup it before doing this.

启动Visual Studio 2012并打开您的项目.

Start Visual Studio 2012 and open your project.

这篇关于Winforms无法在VS2012中加载文件或程序集'Microsoft.ReportDesigner,Version = 10.0.0.0'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆