c# - HtmlAgilityPack.HtmlDocument() 导致错误

标签 c# dll reference html-agility-pack

在我的应用程序中,我想使用已使用 NuGet 安装的 HTMLAgilityPack。但是当我尝试创建 HtmlAgilityPack.HtmlDocument 实例时,我有

"Source not found" error with HtmlDocument.cs.

HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();

Solution Explorer->References 确实包含 HtmlAgilityPack。怎么了?

最佳答案

当您的代码抛出异常并且调试器试图向您显示代码时,或者当您进入调用时,就会发生这种情况。

当你第一次取消“Find Source”对话框时,Visual Studio会将源文件路径添加到一个异常列表中,不会再询问你(这个列表在:Solution Explorer->Right click on solution->Properties->Common Properties->Debug Source Files->Do not look for these source files).

为了防止在调试时出现“HtmlDocument.cs not found”页面,您需要跳过 (F10) HtmlAgilityPack 的调用,而不是进入它们 (F11)。

关于c# - HtmlAgilityPack.HtmlDocument() 导致错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14592635/

相关文章:

reference - 我什么时候不应该为引用该特征的实现者而实现该特征?

c# - Microsoft.Phone.ni.dll 中的 UnauthorizedAccessException

c# - “使用”关键字不起作用

c++ - Kernel32.dll 头信息

c++ - DLL 的导入目录不适用于 64 位 dll

c# - 更新后 System.Reflection 多个程序集错误

reference - const Class & 和 Class const 之间有什么区别吗?

c# - 生成代码中的代码分析警告(如迁移)- Visual Studio (C#)

c# - 使用restsharp put方法更新AtTask中的项目参数

c# - 如何将 C++/CLI 字符串转换为 const char*