question

ConradYoder-1943 avatar image
0 Votes"
ConradYoder-1943 asked TianyuSun-MSFT commented

Stepping through python code called from C#

I've had some code thrown over the wall to me (can't contact the original developer) which is a .NET 5.0 C# project, which calls python code using ProcessStartInfo. I tried to set a breakpoint in the python code but VS gives the warning

The breakpoint will not currently be hit. No symbols have been loaded for this document.

The Visual Studio Python development workload is installed. (Using VS Pro 2019 16.10.2.) I am experienced with C# development, but less so with python. Is this even possible?


dotnet-csharpvs-debugging
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

TianyuSun-MSFT avatar image
0 Votes"
TianyuSun-MSFT answered TianyuSun-MSFT commented

Hello @ConradYoder-1943 ,

Welcome to Microsoft Q&A forum.

Please check these troubleshooting steps which Gregg mentioned here: Troubleshooting steps for when you see “No symbols have been loaded for this document”.

Also please try to enable Just My Code option from Tools > Options > Debugging > General > Enable Just My Code, then Clean > Rebuild your solution, and after that debug it again.

Besides, I’m not sure what your project(folder) structure is, you need to make sure that the .pdb file has been copied in Debug folder.

Best Regards,
Tianyu


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

My project is a .NET 5.0 C# Console app, which calls a python script (source included in the project) via the ProcessStartInfo class. The .pdb file is available - but I guess that is for C# only? The VS debugger won't step into python code.

Maybe I'm asking something of VS that it cannot do?

0 Votes 0 ·

Hi @ConradYoder-1943 , thanks for your reply.

“Maybe I’m asking something of VS that it cannot do?”

Maybe, need to test to confirm this, could you please share me some code snippets to reproduce this issue and test further?

0 Votes 0 ·