繁体   English   中英

.NET Crystal Report错误:找不到类型或名称空间名称'ReportDocument'(您是否缺少using指令或程序集引用…?)

[英].NET Crystal Report Error : The type or namespace name 'ReportDocument' could not be found (are you missing a using directive or an assembly ref…?)

我有一个项目要从Windows 7中的Visual Studio 2012移植到Windows 10中的Visual Studio2017。该项目可以在较旧的计算机上构建并正常运行。 该项目使用Crystal Report。

在尝试使用带有VS 2017的新计算机发布项目时发生多个错误。第一个错误抱怨: CS0246 The type or namespace name 'ReportDocument' could not be found (are you missing a using directive or an assembly reference?) Navi C:\\VS\\Navi\\Picking.aspx.cs 89 Active

文件的第89行说:

public ReportDocument rpt
    {
        get
        {
            return (ReportDocument)Session["PickHeaderrpt"];
        }
        set
        {
            Session["PickHeaderrpt"] = value;
        }
    }

我有3个使用中的显示为灰色(未使用?):

using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System.Configuration;

我已经从下载的文件中安装了适用于Visual Studio的Crystal Report版本13_0_22。 似乎缺少一些参考,但是我仍然对问题出在哪里感到困惑?

这里的问题是该项目缺少一些dll。 当我将代码从Windows 7和VS 2012移植到Windows 10和VS 2017时,新笔记本电脑中缺少原始Crystal Report安装的库/ dll。 由于最新的Crystal Report结构不同,因此安装最新的VS 2017 Crystal Report(版本13_0_22)不能解决dll遗失的问题。

我通过重新安装VS 2012和VS 2008/2012的Crytal Report(版本13_0_7)解决了此问题。 我很幸运在我的旧硬盘上找到了这个。 在新的Windows 10笔记本电脑上执行此操作/重新安装旧版本的Crystal Report,使我清除了与缺少Crystal Report dll问题相关的所有错误。 它甚至允许我在VS 2017上运行项目。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM