在我的应用程序中,我想使用已使用 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/