简体   繁体   中英

C# Remote Debugger - Cannot find or open the PDB file

I'm trying to remote debug my application (C# windows application) according to Remote Debugging , I installed the Remote Tools on my remote machine, say it's RA , and I added permission for the machine I want to debug the application, say it's B .

I open VS in B , Click Debug->Attach to Process..., choose 'Remote =(no authenticated) in Transport, then click the Find button and I can find the machine RA . When I selected this machine and choose the application I'm going to debug, but when I attach it, there's a lot log messages showing that Cannot find or open the PDB file .

Since we need the pdb files to debug on our local machine, then how remote debugging find the pdb files? Or I didn't have it configured correctly on RA ?

Confirm yourself that you can access the pdb files, located on RA, from B. First step is to make a network share of the directory where the pdb's are located on RA. Second step is to open a windows explorer on B and navigate to that specific network share. For example: \\\\RA-MACHINE\\PDB-DIR. Log in with the correct credentials (RA-DOMAIN\\RA-USER, RA-PWD) and tell it to remember your credentials for subsequent logins. The pdb-files should show up in the windows explorer. Configure where the debugger looks for symbol files, as described [ here ] and remote debugging should work.

According to https://msdn.microsoft.com/library/x54fht41(v=vs.100).aspx

By default, the debugger loads symbol files from the location where your EXE is located. To use symbols from another directory or a symbol server, you must specify the locations to Visual Studio.

If you use Azure pipelines with VS 2022 and your.pdb file is present in your web app, you have to publish manually in VS with a profile and then attach the debugger. I tried to get my pipeline to update the.pdb file but was unsuccessful. I never had this issue with VS 2019.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM