簡體   English   中英

在 C# 中使用 Deedle 需要什么 using 語句? “無法加載類型‘Deedle.Frame’”異常

[英]What using statements are needed to use Deedle in C#? "Could not load type 'Deedle.Frame'" exception

第二次編輯:我找到了一個 MS 日志查看器,它沒有啟發我。 這是它顯示的內容:

*** Assembly Binder Log Entry  (10/15/2020 @ 4:09:38 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\IntelliTrace.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Web.Administration, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/IntelliTrace/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = IntelliTrace.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\IntelliTrace\IntelliTrace.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/IntelliTrace/Microsoft.Web.Administration.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/IntelliTrace/Microsoft.Web.Administration/Microsoft.Web.Administration.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/IntelliTrace/deps/Microsoft.Web.Administration.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/IntelliTrace/deps/Microsoft.Web.Administration/Microsoft.Web.Administration.DLL.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/IntelliTrace/Microsoft.Web.Administration.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/IntelliTrace/Microsoft.Web.Administration/Microsoft.Web.Administration.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/IntelliTrace/deps/Microsoft.Web.Administration.EXE.
LOG: Attempting download of new URL file:///C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/CommonExtensions/Microsoft/IntelliTrace/deps/Microsoft.Web.Administration/Microsoft.Web.Administration.EXE.
LOG: All probing URLs attempted and failed.

編輯:我更改了命名空間,但錯誤消息沒有改變。

我有一個很短的 C# 程序。 我第一次嘗試使用 Deedle。 不幸的是,我在網上找到的所有示例都只顯示了可執行代碼,而不是頂部需要的任何 using 語句。 我搜索時找到的頁面都沒有解決這個問題。 這是錯誤消息。

System.TypeLoadException HResult=0x80131522 Message=無法從程序集“Deedle,版本=1.0.0.0,Culture=neutral,PublicKeyToken=null”加載類型“Deedle.Frame”。 Source=<無法評估異常源> StackTrace: <無法評估異常堆棧跟蹤>

這是我的代碼:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Deedle;

namespace DeedleCaller
{
    class Program
    {
        static void Main(string[] args)
        {
            var msftRaw = Frame.ReadCsv(@"C:\Users\afargnoli\Documents\ASRD\Devel\SRFN Data Analytics\link_success_rates\kennett_intervals_jan.csv");
            msftRaw.Print();
            Console.WriteLine("\nPause");
            string unused = Console.ReadLine();
        }
    }
}
...Message=Could not load type 'Deedle.Frame' from assembly 'Deedle...

這告訴您,您沒有可能存在於 Deedle 的 Nuget 中的程序集: https ://www.nuget.org/packages/Deedle

另外,正如 Thomas 所說,如果您更改命名空間會更好。 即“塗鴉項目”。

通過使用新命名空間創建一個新項目來完成最后一件事,然后下載 nugget,它應該可以正常工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM