Visual Studio Debugger Tips You Need To Know

by Jon Davis 22. June 2009 17:45

Came across this article today. It's probably very old, as it's on an ASP Classic file and has no date.

 http://www.eggheadcafe.com/articles/20050511.asp

Good stuff, I didn't know or forgot about half of that stuff. IMO, using a debugger correctly (vs. constant logging and alert pop-ups) is huge when measuring one's productivity.

Incidentally, When looking for a "breakpoints window" I ended up being rather pleased to find that there's a right-click context menu in the breakpoint gutter after a breakpoint has been set in the text editor, revealing:

  • Location - Break execution when the program reaches this location in a file: File: [file path]; Line: [##]; Character: [##]; [checkbox] Allow the source code to be different from the original version
  • Condition - When the breakpoint location is reached, the expression is evaluated and the breakpoint is hit only if the expression is true or has changed. [checkbox] Condition: [textbox] [radio]: Is true; [radio]: Has changed
    • Yessss!! I've SO badly needed this one, I don't know how many times I've pounded F5 while staring at my Watch window waiting for some string to show up in a loop, or actually wrote inline code like
      if (condition && System.Diagnostics.Debugger.IsAttached)
          System.Diagnostics.Debugger.Break(); // my head open against the wall
  • Breapoint Hit Count - A breakpoint is hit when the breakpoint is reached and the condition is satisfied. The hitcount is the number of times the breakpoint has been hit. When the breakpoint is hit [drop-down]:
    • break always
    • break when the hit count is equal to [##]
    • break when the hit count is a multiple of [##]
    • break when the hit count is greater than or equal to [##]
  • Filter - You can restrict the breakpoint to only being set in certain processes and threads. Enter an expression to describe where the breakpoint should be set, or clear the expression to have the breakpoint set in all processes and threads. You can combine clauses using & (AND), || (OR), ! (NOT), and parentheses. Sample clauses:
    • MachineName = "machine"
    • ProcessId = 123
    • ProcessName = "process"
    • ThreadId = 123
    • ThreadName = "thread"
  • When Breakpoint Is Hit - Specify what to do when the breakpoint is hit.
    • [checkbox] Print a message:
      • sample: "Function: $FUNCTION, Thread: $TID $TNAME"
    • [checkbox] Run a macro: [macros drop-down]
    • Continue execution
Wow, that's some powerful breakpoint logic I didn't realize was right under my nose.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Software Development

Nail-biting success with Windows 7 Media Center and CableCard

by Jon Davis 22. June 2009 01:34

I got CableCard working today with Windows 7 Media Center. This is my first CableCard install. The install was not smooth, but it was successful. I'd heard a lot of horror stories about CableCard, but most of these stories were from two years or so ago. I expected the whole matter to be cleaned up by now. It has probably improved a lot, but I was surprised by how bumpy the ride was.

...

COX technicians really, genuinely, deeply hate CableCards. This was the first visit to install CableCard, but the second visit from COX in the last couple weeks where the subject of CableCards came up. These guys acknowledge that the idea behind CableCard is a sound one, but the problem is that they are so different, and the devices are so different, that it's really hard to get a successful install. [I think Microsoft can relate to this sort of experience, being that their software works with most any white box PC on the planet.] Today's installer had a nauseous-looking frown on his face consistently from the moment he climbed the outer stairs to my door until the minute he walked out the door.. although, he had a slight skip in his step when he left. I'm not sure if that's because he was glad the torture was over or if it was because it wasn't another failure.

More at: http://thegreenbutton.com/forums/thread/370299.aspx

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Electronics | General Technology | Pet Projects

IIS Subweb Applications Are Virtual Directories

by Jon Davis 21. June 2009 14:32

Microsoft never ceases to amaze me how they keep showing the most obscure error messages and support documentation for the simplest of causes.

HTTP Error 500.19 - Internal Server Error

Description: The requested page cannot be accessed because the related configuration data for the page is invalid.
Error Code: 0x80070005
Notification: BeginRequest
Module: IIS Web Core
Requested URL: http://www.mysite.com/myapp/
Physical Path: ~~
Logon User: Not yet determined
Logon Method: Not yet determined
Handler: Not yet determined
Config Error: Cannot read configuration file
Config File: ~~
Config Source:

   -1:

    0:
More Information... This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.
 

I was getting IIS 7 error 500.19 on Windows Server 2008 over the weekend, and when I discovered it I spent hours on this error. Google didn't help; everyone pointed to invalid XML in the web.config or in applicationHost.config, or said that there must be an invalid DLL reference in applicationHost.config, or said that I need to add the proper users (IIS_IUSRs, Network Service, IUSR) to the directory and/or web.config. None of these solutions applied. There was nothing in my Windows event logs and enabling IIS tracing produced no log files.

It turned out to be a simple cause: the physical directory as configured in Basic Settings for the application was wrong. Why Microsoft did not include this rather obvious scenario in the Help file for this error is beyond me!!

In my case, my root web was working fine, but my subwebs were not working fine and I got this error for the subweb. The subweb was an individually configured ASP.NET application. I figured that this wasn't important because the root web was just a flat HTML file, but it mattered.

What happened in my case was that a few days ago I had relocated the root web, then updated IIS to point to the new directory. All of the subweb applications, however, were treated by IIS as virtual directories, each with its own physical directory mapping. So each had the stale path. More specifically, I moved "C:\dir\www.mysite.com" to "C:\dir\mysite.com", updated IIS for my site to point to \dir\mysite.com, and left it as such. The applications under ...\mysite.com were each pointing to the stale absolute path of C:\dir\www.mysite.com\[application] instead of picking up the relative path of their parent directory.

I had to update each subweb application's Basic Settings to point to the revised path, and the 500.19 error went away.

Hope this helps others like it would've helped me.

Jon

SQL Server Is Not Case Sensitive!! (Traumatically Humbling Note To Self)

by Jon Davis 15. June 2009 22:29

I don't know if it's a good idea for me to post this. This is so humiliating and humbling that I'm scared that anyone who might actually read my blog would consider me genuinely, well, "one who rides the short bus". 

But SQL Server is not case sensitive. I didn't know that. I've been a web & app developer with SQL Server as my essential RDBMS for .. gosh, twelve years now. Yet, I've frequently used LOWER() and LIKE to try to nudge field/text comparisons to be case insensitive, yet this whole time I didn't need to. SQL is not C#.

This guy speaks my words precisely.

http://www.bennadel.com/blog/723-SQL-Server-Text-Matching-Is-Case-INSENSITIVE.htm

Down to detail. "I am officially retarded," indeed, that's exactly how I feel. Well maybe if more people would blog this then less of us would feel so awful.

How to make it case sensitive? Here's a sample: http://blog.sqlauthority.com/2007/04/30/case-sensitive-sql-query-search/


 

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Jon Davis (aka "stimpy77") has been a programmer, developer, and consultant for web and Windows software solutions professionally since 1997, with experience ranging from OS and hardware support to DHTML programming to IIS/ASP web apps to Java network programming to Visual Basic applications to C# desktop apps.
 
Software in all forms is also his sole hobby, whether playing PC games or tinkering with programming them. "I was playing Defender on the Commodore 64," he reminisces, "when I decided at the age of 12 or so that I want to be a computer programmer when I grow up."

Jon was previously employed as a senior .NET developer at a very well-known Internet services company whom you're more likely than not to have directly done business with. However, this blog and all of jondavis.net have no affiliation with, and are not representative of, his former employer in any way.

Contact Me 


Tag cloud

Calendar

<<  September 2018  >>
MoTuWeThFrSaSu
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

View posts in large calendar