Visual Studio 2013 c#.NET project debugging not working

I have a Visual Studio 2013 solution which is a c#/ASP.net project.  I have inherited it from somebody else and haven't used Visual Studio for about 6 years, and then it was do do VB.NET stuff not ASP stuff.  

I suspect there is a problem with the sql string being sent to the database as it is retrieving null values when it shouldn't so I want to trap the sql string and run it in SQL Server.  I don't have a profiler tool to use on SQL Server at present (client environment).  However, the code doesn't break on any of the breakpoints I've set.  I've tried running it using F10, I've trawled the Internet and tried every suggestion I can find and it still won't work.  Nor can I set any watch windows to monitor the variable contents.  The code in question is in default.aspx in the PreLoad event.

Any thoughts on what else I can try?  Many thanks

A
SokellaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

käµfm³d 👽Commented:
Are you in Debug or Release mode?
0
SokellaAuthor Commented:
I'm pretty sure it is in debug mode. Thanks.
0
Fernando SotoRetiredCommented:
Hi Sokella;

Seeming that you are in debug mode you should also check that debug is enabled. To do that check the web.config file to make sure that in the compilation node you have debug="true" as shown below.

<configuration>
  ...
  <system.web>
    ...
    <compilation debug="true" ... />
    ...
  </system.web>
  ...
</configuration>

Open in new window

0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

SokellaAuthor Commented:
OK, so I attach a screen shot that shows that bit of the web.config.  I believe the answer to your question is true, and I also know that sometimes seeing it can give something away that you wouldn't otherwise know.
web.-config.jpg
0
Fernando SotoRetiredCommented:
Sorry, the application is in debug mode and NOT in release mode and the web.config has debug enabled. I do not Know what else to have you try.
0
SokellaAuthor Commented:
Ok. Thanks for trying. This is crazy that it doesnt work.
0
käµfm³d 👽Commented:
Sorry, the application is in debug mode and NOT in release mode and the web.config has debug enabled.
Erm, I'm not talking about that setting; I'm talking about this setting:

Screenshot
Enabling the web.config setting is only 1/2 of what you need to do for debugging in ASP.NET projects. If you don't build the project under Debug configuration, then you won't get the .pdb files that are necessary for debugging--hence, no debugging.
0
SokellaAuthor Commented:
Thanks kaufmed. Yes that mode is on it is also in the screen shot.  Any other ideas?
0
kjsiemekCommented:
Just off hand, provided the previously discussed settings are correct - try looking at Tools->Options->Debugging and making sure Enable Edit and Continue is checked?   Also, you may want to look under Debugging->General and check those out.  Hope this helps.
0
SokellaAuthor Commented:
Many thanks kjsiemek

I attach screen shots of those settings in case anything strikes you as odd.

A
Debug-Editcontinue.jpg
Debug-Gen.jpg
0
kjsiemekCommented:
How about under Project->Properties and the DEBUG option on the left?   There is a section labeled "Enable Debuggers" - I have "enable the visual studio hosting process" checked.  Maybe there?
0
SokellaAuthor Commented:
Unfortunately, the server was rebooted today and now when I try to open the VS project It fails to load.  Apparently the project is configured to use IIS (yes!) and I don't have sufficient permissions to access IIS on the machine. I am however an administrator!

This project is driving me absolutely mad.
0
SokellaAuthor Commented:
OK - fixed the above problem  Had to navigate to %systemroot%\inetsrv\config
Then request permission to the folder and hey presto!!

I don't seem to have a DEBUG option on the left in the Project > Properties -
Can you send me a screen shot please so I can see if I'm looking in the right place. This is what I can see.
ProjectProperties.jpg
0
kjsiemekCommented:
That is the right spot, but it's not there because this is a web application, my apologies.

Have you tried setting up a break point somewhere else, to see if maybe it's just not reaching yours?
0
kjsiemekCommented:
Maybe make sure you are in DEBUG and to a Build->Rebuild Solution?  Maybe your PDB files are out of sync?
0
SokellaAuthor Commented:
I'm pretty sure it is getting there - it kind of flashes red circle with white centre when it gets there and back to red again afterwards.
0
kjsiemekCommented:
Or, To go Tools->Attach to Process...

Pick Select... button next to Attach To: and select
Manage (v2.0, v1.1, v1.0) - or whatever version you are using.  Maybe the environment is not syncing properly with the Automatic Select.
Attach.png
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SokellaAuthor Commented:
Ok, so I've established that the initial errors were that the HTML wasn't rendering.  I've fixed all those errors so now the application is running and I'm getting an error returned by the application.  However it still won't break at the breakpoints.

I have tried the Attach To process and was advised to select the w3wp.exe by somebody else, however this hasn't worked.  I can't see a Manage process as you describe - have I misunderstood?

OK - just tried it again and used Step Into rather than Run and it seems to have worked.  Eureka - thanks for all your help.
0
SokellaAuthor Commented:
Incomplete, but in the right area.
0
kjsiemekCommented:
Glad you got it working!  That can be frustrating.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.