https://stackoverflow.com/questions/628565/display-lines-number-in-stack-trace-for-net-assembly-in-release-mode/628590#628590
1. Go into the Properties window for the project where you want to see stack trace line numbers.
2. Click on the Build "vertical tab".
3. Select "Release" configuration.
Check the DEBUG constant parameter.
4. Uncheck the "Optimize code" parameter to avoid the occasional trace issue with inlined code (this step is not essential).
5. Press the Advanced... button and choose Output -> Debug Info -> pdb-only.
6. Deploy the generated .pdb file with the assembly.