Results 1 to 10 of 10

Thread: [RESOLVED] What is a PDB file ?

  1. #1

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,423

    Resolved [RESOLVED] What is a PDB file ?

    Hi,

    I have a problem with an application.
    The application runs correctly in 'Debug', but fails when I run it from it's .exe file in the Debug folder.

    The 'Build' file contains this report:
    'NewDiary.vshost.exe' (CLR v4.0.30319: NewDiary.vshost.exe): Loaded 'C:\VB Projects\VS 13\Projects\NewDiary\NewDiary\bin\Debug\NewDiary.exe'. Symbols loaded.
    'NewDiary.vshost.exe' (CLR v4.0.30319: NewDiary.vshost.exe): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Remoting\v4.0_4.0.0.0__b77a5c561934e089\S ystem.Runtime.Remoting.dll'. Cannot find or open the PDB file.
    A first chance exception of type 'System.IO.IOException' occurred in Microsoft.VisualBasic.dll
    Sadly I don't know to which file this report is referring. I can find no files in the code which do not exist in the folder specified. (And no, none are just directly in C:\) I think that the fact that the application runs correctly in debug mode confirms that the files are all where the filepath says they are.
    As it happens, if I did know which file, I might not know what to do about it !

    Poppa.
    Along with the sunshine there has to be a little rain sometime.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,297

    Re: What is a PDB file ?

    What do you not understand about the information you found when you searched the web for "what is a pdb file"? As to why your application should require its presence, I'm not sure about that. I could search the web for some information as to why it might be so but you're just as capable of that as I am.

  3. #3

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,423

    Re: What is a PDB file ?

    Quote Originally Posted by jmcilhinney View Post
    What do you not understand about the information you found when you searched the web for "what is a pdb file"? As to why your application should require its presence, I'm not sure about that. I could search the web for some information as to why it might be so but you're just as capable of that as I am.
    Well, I spent nearly three hours trying to find a definitive answer in MSDN, but as usual there are so many pages, all piggy-backed onto one another. I gather that a .pdb file is likely to be a programming de-bugging file, but that doesn't help much, MSDN say that the files 'could be' in the 'relevant' .dll file... Some help !

    I just hoped someone in here would give me some help, usually I find the answers helpful, but not always.

    Poppa.
    Along with the sunshine there has to be a little rain sometime.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,297

    Re: What is a PDB file ?

    It took me less than a second on Google to find this:
    A program database (PDB) file holds debugging and project state information that allows incremental linking of a Debug configuration of your program. A PDB file is created when you compile a C/C++ program with /ZI or /Zi or a Visual Basic/C#/JScript .NET program with /debug.
    I searched for "what is a pdb file", just as I said. A few more seconds would presumably have yielded more useful information. I guess being able to search the web must be my super power, judging by how often others seem unable to do it.

  5. #5
    Addicted Member omundodogabriel's Avatar
    Join Date
    May 2013
    Posts
    177

    Re: What is a PDB file ?

    Have you tried to compile the application as Release?

  6. #6
    Frenzied Member
    Join Date
    Jul 2011
    Location
    UK
    Posts
    1,335

    Re: What is a PDB file ?

    Quote Originally Posted by Poppa Mintin View Post
    The application runs correctly in 'Debug', but fails when I run it from it's .exe file in the Debug folder.
    You've not said what you're trying to do, but if this is about trying to get the JiT debugger to work, then I'd advise you not to bother.

    The symptoms you describe are most often caused by an exception being raised during execution of code in the Form Load event handler, or a method called from the Form Load event handler. When run from the VS IDE on a PC that has a 64 bit operating system, such exceptions will be silently swallowed. However, outside of the IDE, the exceptions are raised as normal.

    The stack trace you posted in your other thread seems to back this up (read it from bottom to top):
    ************** Exception Text **************
    System.IO.IOException: Bad file name or number.
    at Microsoft.VisualBasic.FileSystem.GetChannelObj(Assembly assem, Int32 FileNumber)
    at Microsoft.VisualBasic.FileSystem.GetStream(Assembly assem, Int32 FileNumber, OpenModeTypes mode)
    at Microsoft.VisualBasic.FileSystem.EOF(Int32 FileNumber)
    at NewDiary.Form1.GetDataC()
    at NewDiary.Form1.Form1_Load()
    at ....
    which is basically saying that when the Form_Load() Sub was called, it called the GetDataC() Sub, which in turn called the EOF() method, and the exception was raised during the execution of the EOF method.

    As far as I am aware, running the .exe from outside the IDE with JiT debugging enabled causes exceptions raised from the Form Load event handler to be similarly swallowed, just as if you were running the code from the IDE , so JiT debugging won't be much use to you.

    If you do a bit of research into how to prevent exceptions being swallowed under the above conditions, the advice you normally see includes moving all the code from the Form_Load() Sub to either the Form_Shown() Sub or to the Sub New(), or wrapping all the code in the Form_load() Sub inside a Try... Catch... End Try statement, which at its simplest would look something like:
    VB.NET Code:
    1. Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    2.     Try
    3.  
    4.         'all the original code
    5.         'from the Form_Load Sub goes here
    6.  
    7.     Catch ex As Exception
    8.         MsgBox(ex.Message & vbNewLine & ex.StackTrace)
    9.     End Try
    10. End Sub
    You should be able to examine the stack trace to find the line number where the error occurred.


    My guess is that you read data from your .txt file inside a Do Loop, checking for EOF(fileNumber) in order to exit the loop. If you find the data has a syntax error ("typo"), you update a TextBox and then close the file, but still let the loop continue to the EOF statement. At this point, an exception will be raised because you cant check for EOF against a closed file. But I can only guess without seeing your code.


    If you don't have a 64 bit operating system, then all the above will be somewhat academic.
    Last edited by Inferrd; Jul 27th, 2015 at 06:08 AM. Reason: tidy up

  7. #7

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,423

    Re: What is a PDB file ?

    Quote Originally Posted by Inferrd View Post
    If you don't have a 64 bit operating system, then all the above will be somewhat academic.
    Thank you Inferrd, that's very helpful, I can try your 'Try' suggestion, but I think you've 'hit the nail on the head' with what's going on, so I'll try reprogramming all three 'Getdata' subroutines, I'll ensure the data is totally read-in to a new Listbox, and FileClosed() before I start servicing the data.
    Actually, this is a re-working of an application which I wrote many years ago and which has been working daily ever since, I suspect this problem has always been there.

    (Yes it's a 64 bit system)


    Poppa.
    Along with the sunshine there has to be a little rain sometime.

  8. #8

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,423

    Re: What is a PDB file ?

    Quote Originally Posted by jmcilhinney View Post
    It took me less than a second on Google to find this:I searched for "what is a pdb file", just as I said. A few more seconds would presumably have yielded more useful information. I guess being able to search the web must be my super power, judging by how often others seem unable to do it.
    Yes, I did all that before asking the question... But it doesn't help with what to do about it... Maybe I asked the wrong question, but I'm sure Inferrd's post has helped, thanks to that post, I shall mark this thread as resolved.

    Poppa.
    Along with the sunshine there has to be a little rain sometime.

  9. #9
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: [RESOLVED] What is a PDB file ?

    If you want to create a .pdb file, there is a setting "Generate debug info" under the "Advanced compile options" button on the Compile properties. Set this to "Full" or "pdb-only"

  10. #10

    Thread Starter
    PowerPoster Poppa Mintin's Avatar
    Join Date
    Mar 2009
    Location
    Bottesford, North Lincolnshire, England.
    Posts
    2,423

    Re: What is a PDB file ?

    Quote Originally Posted by Poppa Mintin View Post
    Thank you Inferrd, that's very helpful, I can try your 'Try' suggestion, but I think you've 'hit the nail on the head' with what's going on, so I'll try reprogramming all three 'Getdata' subroutines, I'll ensure the data is totally read-in to a new Listbox, and FileClosed() before I start servicing the data.
    Poppa.
    Just an up-date...

    Thank you Inferrd, making the assumption that your diagnosis was correct, I added a new ListBox and read-in all the data to that, closed the file and just changed from reading the input file directly, to reading the ListBox. About five extra lines of code. My application now runs as intended. Thanks again.

    Poppa.
    Along with the sunshine there has to be a little rain sometime.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width