0

I'll start by saying that I have searched SO and not found an answer to my issue.

I want to place a breakpoint in my asp.net code behind, and when a method or function of a class library is being called, I would like to be able to step into the class library code.

I have added the class library code files to my asp.net solution file.

Attach to process does not work (the class library code behind does not come up). I have also confirmed that the pdb file exists in the \bin folder .... according to this post ASP.NET Class Library not hitting break points

This is my screenshot of processes: enter image description here

Any ideas how to go about stepping into the class library?

Community
  • 1
  • 1
DNR
  • 3,706
  • 14
  • 56
  • 91

3 Answers3

2

You have to attach to w3wp, the worker process for asp websites, the dll should be in there.

However, if the code is referenced directly, then the built-in VS debugger should work. Are you sure you are running in debug?

Justin Pihony
  • 66,056
  • 18
  • 147
  • 180
1

If you're running from debug, you should see the class library and the symbols loaded in the output window. Look for something that looks like the following:

'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\b2719ea1\480fba3f\assembly\dl3\c439d1ec\8c571aed_7e45cd01\MyClassLibrary.DLL', Symbols loaded.

If you see your class library being loaded but it doesn't say "Symbols loaded" at the end, then it's not finding the .pdb file for some reason.

Also, if you're running from debug, you can attach to WebDev.WebServer40.exe from the 'Attach to Proccess" box. But you shouldn't have to - if the symbols are loaded and you're running in debug mode you ought to be able to hit your breakpoint without explicitly attaching to the process.

Are you able to hit breakpoints in code that's not in your class library?

BDW
  • 612
  • 1
  • 8
  • 20
  • "Are you able to hit breakpoints in code that's not in your class library?"... Yes – DNR Jun 15 '12 at 19:17
  • from the output window (does not say symbols loaded.. so how I ensure that the pdb is found?): 'WebDev.WebServer40.EXE' (Managed (v4.0.30319)): Loaded 'C:\Users\aazzao\AppData\Local\Temp\Temporary ASP.NET Files\root\8770d266\36a71f3e\assembly\dl3\ca9f9930\12082593_6b49cd01\AutoCare.Libraries.Common.DLL' – DNR Jun 15 '12 at 19:21
  • That's probably your issue then. Is the class library being rebuild when your rebuild your solution? Does the .dll and the .pdb match up? I'd try deleting the .pdb and doing a clean rebuild and see if it gets regenerated. – BDW Jun 15 '12 at 19:24
  • Also - under the solution properties, under Common Properties\Project Dependencies, make sure that your main website depends on your class library. – BDW Jun 15 '12 at 19:26
  • Did all the stuff in your last two comments. No luck. – DNR Jun 15 '12 at 19:38
  • 1
    Have you double-checked the reference? Is it possible that it's not loading the .dll from the bin file, but instead is referencing a different/older version? – BDW Jun 16 '12 at 11:59
  • That was it (though I could have sworn it was pointing to the correct path). Thanks very much for your help. – DNR Jun 18 '12 at 12:46
0

Make sure you have the "Show processes from all users" checked and then attach to the w3wp process for your website.

lkaradashkov
  • 8,609
  • 1
  • 15
  • 12
  • I don't see w3wp process in my list of "Attach to Processes" (Show processes from all users is checked) – DNR Jun 15 '12 at 18:55