If there is an error in an application, the line numbers are only included in the Stack Trace when the PBD files are also in the application directory.
To include the PBD files in an application that was distributed with ClickOnce deployment you need to:
- Right click the main project and select Properties
- On the Build tab
- On the Publish tab click the Application Files… button