Monday, April 14, 2008

Debugging: No Locals, Breakpoint not being hit, etc in Visual Studio

Problem: sometimes, VS has trouble seeing Locals for optimized assemblies. Also, even with symbols loaded for a module, a breakpoint is not hit. Or you attach to the w3wp.exe process only to not see your module as loaded (and you know it is).

Solution: say your assembly is My.dll

  1. Create a file called My.ini
  2. Put this content into that file:
  3. [.Net Framework Debugging Control]
    AllowOptimize=0
    GenerateTrackingInfo=1

  4. Copy the .ini file to the location of the assembly in the GAC