【问题标题】:Microsoft ReportViewer 2012 ReferenceMicrosoft ReportViewer 2012 参考
【发布时间】:2014-05-31 14:53:57
【问题描述】:

我在 %WINDIR%/Assembly 中有 Microsoft.ReportViewer.WinForms 版本 11.0.0.0,publickeytoken 89845dcd8080cc91。实际文件版本为 11.0.3412.0。我安装了 2012 ReportViewer 可再发行组件。我去添加对我的 .NET 4.0 C# 项目的引用,唯一可用的选择是 10.0.0.0,文件版本 10.0.40219.329。所以我浏览到 %PROGRAMFILES% (x86)/Microsoft Visual Studio 12.0/ReportViewer/Microsoft.ReportViewer.WinForms.dll,它显示为 11.0 版本,但添加时 csproj 文件引用了 10.0 版本:

<Reference Include="Microsoft.ReportViewer.WinForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>C:\Program Files (x86)\Microsoft Visual Studio 12.0\ReportViewer\Microsoft.ReportViewer.WinForms.dll</HintPath>
    </Reference>

当我构建并部署到 32 位机器时,DLL 的使用提示来自缺少的 DLL - 10.0.0.0 - 为什么它不会选择 2012 版本?

【问题讨论】:

    标签: c# .net visual-studio-2013 report-viewer2012


    【解决方案1】:

    我不能说我遇到过这种情况。我已经能够安装redistributable from the Microsoft website 并且程序集的版本 11.0 已安装在 GAC 中。

    我没有安装 Visual Studio 2013,这是“Microsoft Visual Studio 12.0”目录所在的位置。但我的“Microsoft Visual Studio 11.0”目录中也有正确的 ReportViewer.WinForms 程序集。

    如果您真的想查看是否存在正确的引用,您可以尝试手动编辑您的项目文件以引用 ReportViewer.WinForms 的第 11 版,方法是将其编辑为:

    <Reference Include="Microsoft.ReportViewer.WinForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL" />
    

    这应该尝试从 GAC 加载程序集。但我怀疑这会奏效。老实说,我会尝试重新安装 SSRS 2012 Report Viewer Runtime Redistributable。

    【讨论】:

    • @user210757 .NET 4.0 和 .NET 4.5。
    • 这行得通 - 这是为我添加此参考的唯一方法 - 我在 VS2013 Update 2 RC 上。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2010-11-20
    • 1970-01-01
    • 1970-01-01
    • 2015-05-04
    • 2014-06-07
    • 2012-02-16
    • 1970-01-01
    相关资源
    最近更新 更多