0

I copied my project to a dsik on key and tried to run it in my mother home pc. In my code im using HtmlAgilityPack.HtmlWeb and i have this line:

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(); Im moving to a 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:\

I have also a try and catch in my function test if i put a breakpoint on the catch i see:

IOexception was caught. 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.

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.dllim Its not missing.

So i wonder why its looking for a file on 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.

So what did i do wrong here ? And how should i fix/repair it ?

4
  • Isn't GatherLinks.Form1.removeDuplicates your code? Can't you trace/print what path it uses to open a StreamWriter? Commented Sep 17, 2012 at 17:40
  • Does the HTMLAgilityPack live on the D:\ drive of the machine you developed it on? Commented Sep 17, 2012 at 17:58
  • Dave Zych yes it is on D:\ on my machine at my home where i developed the application. Its not eaxist at all on my mother pc. Commented Sep 17, 2012 at 18:02
  • Alexi Levenkov i removed the streamwriter i dont need it but it didnt solve the problem yet. Still breakpoint on the line give me no source available. Commented Sep 17, 2012 at 18:04

1 Answer 1

1

I erased the HtmlAgilityPack.pdb and it worked just fine. Erase the file, rebuild, close and reopen and see if it works

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.