We had a particular environment that we were unable to get the custom server code to debug. Follow the steps below to ensure you hit the breakpoint.
-
Click Tools > Options, and click Debugging > General.
-
Clear Enable Just My Code (Managed only).
-
Once you attach, you should see only one copy of your custom assembly in the loaded modules list.
To view the loaded modules list click Debug > Windows > Modules.
If there are two copies of your custom assemble, where one has a path in the ASP.NET cache area, the debugger will not break in your code. Completing steps 2 and 3 above should fix this problem.
If you find that multiple copies of your dll are loading, you can fix it by explicitly telling Visual Studio which symbols to load.
-
Right click on one of your duplicate DLLs.
-
Click Symbol Settings on the shortcut menu.
-
Type in your build location, and choose to search that location only.
-
Rebuild and you should only have one copy of your DLL in the loaded modules listing.