Recently ran into an issue where we wanted to get line numbers from exception stack traces that are being logged for a clients site. We followed all the instructions we found online but nothing got us what we wanted. We had PDBs for all our DLLs in the bin folder, we tried deploying a full debug version but nothing got us what we wanted. After many searches we came across a mention that if you are having your app impersonate (which we are not) to make sure the account that is being impersonated is a member of the Debugger Users group. Since we are using a custom App Pool Identity we decided it was worth a shot and made the change in AD. Voilà! We’ve got line numbers in our logs and now I can finally fix that pesky null reference exception.
Why it works
There’s more knowledgeable people out there that can explain it better but from my understanding when an exception is thrown and you access the stack trace a debugger instance of sorts is ran on the matching PDB and if the current user does not have correct permissions to perform this action the PDB can’t be processed and you just get minimal information.