Web developers wiki ASP.NET Sitecore Sharepoint Kentico by Evident Interactive

Cannot debug a site

Modified: 2008/11/17 11:44 by k.schepens - Categorized as: Sitecore, Visual Studio
There are multiple reasons this can happen and there are many causes. Also, there are a number of symptoms. I will handle a few known issues in this article.

Edit

Cannot debug at all, Visual Studio hangs

This is a common problem in Visual Studio and is related to the 'show all files' option in the Solution explorer. For more info, see Visual Studio hangs when debugging.

Edit

Debugging starts but breakpoint is disabled on debug

There can be a couple of reasons for this. I'll describe the most common below.

Edit

Optimization is enabled for this module

Symptoms

You just added a breakpoint in your code. When you try to debug your code, the breakpoint is disabled and the warning 'The breakpoint will not currently be hit. No symbols have been loaded for this document.' is shown when you hover the breakpoint. Optionally, you may get a warning that claims 'The following module was built either with optimizations enabled or without debug information'. After that, it shows the module name you were planning to debug.

Cause

Optimization is enabled for the module you are trying to debug.

Solutions

There are two solutions for this problem:

1. Disable optimization for the specific module.
- In Visual Studio, go to the properties of your project (module).
- On the tab 'Build', deselect the option 'Optimize code'

2. Disable 'just my code' in debug options.
- In Visual Studio menu bar, go to 'Tools' > 'Options'.
- In the tree on the left, choose the item 'Debugging' > 'General'
- In the view on the right, disable the 'Enable Just My Code (Managed Only)' option

Optionally, you can enable a warning when a project in your solution has no user code by checking 'Warn if no user code on launch'.

 © Evident Interactive BV