views:

1011

answers:

5

When I add a breakpoint and hit F5 to run in the debugger (I am using my debug build), a dialog pops up telling my my web.config file does not have debug=true in it (which is does) and I get 2 choices a) run without the debugger or b) let visual studio update my web.config file. If I choose b) the web.config is updated badly and nothing will work. If I choose a) then the site appears and I can test it out, but no debugging.

I am an experienced developer, but I have never used visual studio and asp.net for web development before, so I am feeling rather frustrated by all the walls it is putting up to prevent me working.

So far I have not been able to use the debugger. Is there something totally obvious that I am missing? What would you check if it was happening to you?

+2  A: 

Open web.config manually and make sure the following line is in there

<compilation defaultLanguage="c#" debug="true" />

Now you should be able to debug from VS. If this does not work I suggest that you recreate the project.

EDIT: perhaps from what you say it could be that web.config is screwed up, e.g.contains invalid xml, no closing tag for some element etc.

liggett78
Yep, that line is there, which is why it is so puzzling. recreating the project would be complicated (it is a very big project that I have inherited).
rikh
+1  A: 

ligget78 said it first ^^

Try to delete completely web.config and let Visual Studio recreate it, if possible.

controlbreak
I hope you dont have that much custom setting in web.config file...
controlbreak
There seems to be a lot of rewrite rules in there, but I will give this a try.
rikh
A: 

If the debug=true is enabled then there is some problem in the Internet Application Server application. Try re-creating the web application and let Visual Studio create the web site.

Check also that the cassini web server is set up to be used as the debugging web server in the project properties.

massimogentilini
massimo is right, this issue may depend on the way the application is hosted during the debug session. Are you using IIS or a file system with the tiny webapp server ?
controlbreak
as far as I know, IIS. Debugging has worked in the past - it's just for me that it's broken :-)
rikh
+1  A: 

I agree with what was posted above, but another thing you can check is to, make sure that your page header in your aspx files does not disable debugging:

<%@ Page Language="C#" MasterPageFile="~/default.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="some title" Debug="false" %>

^^ that will turn off debugging.

naspinski
+1  A: 

In your project do a solution wide search for 'debug=' and if only one shows up then do a folder search. I've had it happen where there are multiple config files and this can cause problems.

osp70