C# 无法加载文件或程序集 Microsoft.ReportViewer.WebForms 或其依赖项之一

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14857621/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 13:14:19  来源:igfitidea点击:

Could not load file or assembly Microsoft.ReportViewer.WebForms or one of its dependencies

c#visual-studio-2012reportviewer

提问by user1269625

When I goto my site I get this error...

当我转到我的网站时,我收到此错误...

Error   101 Could not load file or assembly 'Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. C:\mlui\csharp\WebAdmin_solution\WebAdmin\web.config    209

which is this line of code:

这是这行代码:

<add assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />

I am using Visual Studio 2012, do I need to download something and add it to the VS 2012 folder?

我正在使用 Visual Studio 2012,是否需要下载某些内容并将其添加到 VS 2012 文件夹中?

回答by Garry

try to update it with latest assembly of version 10.0 by add reference to your project and build it again after adding assembly file will looks something like below

尝试使用最新的 10.0 版程序集更新它,方法是添加对您的项目的引用,然后在添加程序集文件后再次构建它,如下所示

Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

回答by Thorsten Dittmar

If you're actually using the Reporting Services, try to install the Reporting Services redistributable on the server you deploy your web site to or include the required assemblies with your web application.

如果您实际使用的是 Reporting Services,请尝试在您将网站部署到的服务器上安装 Reporting Services 可再发行组件,或将所需的程序集包含在您的 Web 应用程序中。

回答by Bruno Pinto

Look at your folder instalation, what version have the folder ReportViewer. And put Version=X.0.0.0 where X means the version of your instalation.

看看你的文件夹安装,什么版本有文件夹ReportViewer。并放置 Version=X.0.0.0 其中 X 表示您的安装版本。

In my case, I have

就我而言,我有

Instalation Folders

安装文件夹

But only inside 10.0 I have the ReportViewer

但只有在 10.0 中我才有 ReportViewer

ReportViewer Folder

报表查看器文件夹

And my web.xml is like this

而我的 web.xml 是这样的

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

回答by BJ Patel

Right Click on the Project and open and go to Manage NuGet Package

右键单击项目并打开并转到管理 NuGet 包

Under browse tap search for Microsoft.Reporting.WebForms

在浏览下点击搜索Microsoft.Reporting.WebForms

select Microsoft.ReportView.Webforms

选择 Microsoft.ReportView.Webforms

enter image description here

在此处输入图片说明

and click install.

然后点击安装。

  • so it will take care of respective dependency and so on,
  • 所以它会处理各自的依赖等等,