c# - 命名空间 'Utility' 中不存在类型或命名空间名称 'Aspose.Cells'(您是否缺少程序集引用?)

标签 c# asp.net json visual-studio-2013 namespaces

Heyyy.. 我现在正面临一个泡菜。
我需要开发一个程序,其中一个功能是可以将 JSON 文件转换为 CSV 文件。
这是我所拥有的:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.IO;
using Aspose;
using Aspose.Cells;

namespace WpfApplication1
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string str = File.ReadAllText(@"C:\cpi\log\V510ResultsInfo\cpi001.json");

            Aspose.Cells.Workbook workbook = new Aspose.Cells.Workbook();

            Aspose.Cells.Cells cells = workbook.Worksheets[0].Cells;

            Aspose.Cells.Utility.JsonLayoutOptions importOptions = new 
            Aspose.Cells.Utility.JsonLayoutOptions();
            importOptions.ConvertNumericOrDate = true;
            importOptions.ArrayAsTable = true;
            importOptions.IgnoreArrayTitle = true;
            importOptions.IgnoreObjectTitle = true;
            Aspose.Cells.Utility.JsonUtility.ImportData(str, cells, 0, 0, importOptions);

            workbook.Save(@"C:\cpi\log\V510ResultsInfo\convertedjson.csv");
        }
    }
}
问题是 '实用程序' 'Aspose.Cells.Utility' .. 一直在网上搜索让我头疼,但似乎没有什么关于这个的事情..
我所知道的是“Aspose.Cells.Utility.JsonLayoutOptions”位于“Aspose.Cells.Utility”命名空间中,该命名空间属于 Aspose.Cells.dll .. DLL 没有任何问题,一切都很好.. 只是错误仍然存​​在:
错误消息:命名空间“Aspose.Cells”中不存在类型或命名空间名称“Utility”(您是否缺少程序集引用?)

最佳答案

添加到 jayrag 提供的答案中,我想说的是,Apsose.Cells.Utility 似乎是一个较新的命名空间,因此它不适用于旧版本的 Aspose。我刚刚检查了它的版本 17,它绝对不可用。我也无法在 Aspose.Cells 中找到任何可以帮助您的替代方法。似乎 json 支持仍然很新,要使用它,您需要升级许可证。鉴于 aspose 的价格,您可能应该进行变通。希望那些对你有帮助。
干杯!

关于c# - 命名空间 'Utility' 中不存在类型或命名空间名称 'Aspose.Cells'(您是否缺少程序集引用?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67395803/

相关文章:

c# - AxAcroPDFlib 引用

c# - 如何在 Orchard 的特殊区域中为特殊小部件创建 View 替代?

c# - 为什么 Timespan.TryParseExact 没有按预期解析输入?

asp.net - 如何从 View 中获取表数据是 asp.net mvc 4

c# - WCF 服务和 COBOL VM

c# - 结构列表 - 结构项的值始终为 null

javascript - 根据请求加载 Google map 标记 HTML

android - 如何解析 facebook JSON 响应

java - 如何使用 Java 中的 GSON API 自定义 JSON 中的特定日期字段?

javascript - 为什么我会超出最大调用堆栈?