简体   繁体   English

“无可用源”错误

[英]'No Source Available' Error

I copied my project to a dsik on key and tried to run it in my mother home pc. 我将项目复制到密钥上的dsik上,并尝试在我的母亲家用PC中运行它。 In my code im using HtmlAgilityPack.HtmlWeb and i have this line: 在我使用HtmlAgilityPack.HtmlWeb代码中,我有这一行:

private List<string> test(string url, int levels,DoWorkEventArgs eve)
        {
            levels = 0;
            HtmlWeb hw = new HtmlWeb();

If i run my program it will not throw any exception but will continue just will not do anything. 如果我运行程序,它将不会引发任何异常,但是会继续执行任何操作。 If i put a breakpoint on the line: HtmlWEb hw = new HtmlWeb(); 如果我将断点放在行上: HtmlWEb hw = new HtmlWeb(); Im moving to a No Source Available window : 我将移至“ No Source Available window

Locating source for 'D:\Source\htmlagilitypack.new\Trunk\HtmlAgilityPack\HtmlWeb.cs'. Checksum: MD5 {58 c1 63 f6 cd 5 65 de 4c 3c d5 4b b1 b7 7 48}
The file 'D:\Source\htmlagilitypack.new\Trunk\HtmlAgilityPack\HtmlWeb.cs' does not exist.
Looking in script documents for 'D:\Source\htmlagilitypack.new\Trunk\HtmlAgilityPack\HtmlWeb.cs'...
Looking in the projects for 'D:\Source\htmlagilitypack.new\Trunk\HtmlAgilityPack\HtmlWeb.cs'.
The file was not found in a project.

I see that HtmlWeb.cs is missing in some directory on D:\\ 我看到HtmlWeb.cs在D:\\的某个目录中丢失

I have also a try and catch in my function test if i put a breakpoint on the catch i see: 如果我在catch上设置了一个断点,我也会尝试在功能测试中使用catch:

IOexception was caught. IOexception被捕获。 The device is not ready. 设备未准备好。

My guess that its looking for a file maybe HtmlWeb.cs in D:\\ And in my mother pc D:\\ is a DVD drive in my pc its hard disk. 我猜想它可能在D:\\中寻找文件HtmlWeb.cs ,而在我的母机D:\\则是它硬盘中的DVD驱动器。

The full exception: 完整的例外:

System.IO.IOException was caught
  Message=The device is not ready.

  Source=mscorlib
  StackTrace:
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
       at System.IO.StreamWriter.CreateFile(String path, Boolean append)
       at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
       at System.IO.StreamWriter..ctor(String path)
       at GatherLinks.Form1.removeDuplicates(List`1 a, List`1 b) in F:\GatherLinks\GatherLinks\Form1.cs:line 250
       at GatherLinks.Form1.test(String url, Int32 levels, DoWorkEventArgs eve) in F:\GatherLinks\GatherLinks\Form1.cs:line 111
  InnerException: 

I dont see any problems in my code in the reference area with the HtmlAgilityPack.dll im Its not missing. 我没有在参考区域的HtmlAgilityPack.dll im代码中发现任何问题,它不丢失。

So i wonder why its looking for a file on D:\\ ? 所以我想知道为什么要在D:\\上寻找文件? If on my pc i did rebuild/build solution and saved it all i was sure its adding all the files and dll's it needs to the project so if i copy it to my disk on key and run it on my mother pc it will work. 如果在我的PC上我确实进行了重建/构建解决方案并保存了所有内容,那么我确定它已将所有文件和dll's添加到了项目中,因此,如果我将其复制到密钥上的磁盘上并在我的母亲PC上运行,它将可以正常工作。

So what did i do wrong here ? 那我在这里做错了什么? And how should i fix/repair it ? 我应该如何修理/修理它?

I erased the HtmlAgilityPack.pdb and it worked just fine. 我擦除了HtmlAgilityPack.pdb,它工作得很好。 Erase the file, rebuild, close and reopen and see if it works 删除文件,重新生成,关闭并重新打开,看看它是否有效

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

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