debugging

Why would I want to use the debug mode of the .NET compiler?

I was curious what the differences are between the debug and release modes of the .NET compiler and came across these questions about debug vs release in .NET and reasons that release will behave differently than debug. Up to this point I really haven't paid much attention to these compiler modes. Now I will. My question is, assumin...

How do you debug an ASP.Net application accessing an OAuth secured API?

I know there has to be an obvious solution to this problem and I am missing it, so I would much appreciate someone enlightening me so I don't spin my wheels... I am writing an ASP.Net application that will interact with a service API (Evernote specifically). Evernote requires OAuth for security and before I can actually interact with t...

Build does not catch errors in the View in asp.net mvc

Why don't we get compile errors on inline code errors in asp.net mvc views f.eks <h1><%= ViewData.Model.Title.Tostrig() %></h1> The code above will build just fine. Wrong spelling in webform controls will give you an error so I can't see why this isn't supported in asp.net mvc EDIT: Luckily there seem to be a fix included in the firs...

The URI you submitted has disallowed characters.

I have a code igniter project, and I wanted to try debugging it using Zend Studio. WHen I start debugging, I immediately run ino "The URI you submitted has disallowed characters." Does anyone have any idea? ...

How to determine a swing component?

Hi guys, I have a problem. I'm working on another guy's code and there is a JFrame with lots of JSeparators(he used them as borders for 'panels') now I'm replacing them for a JBorderedPanel class that follows the same border style of the whole application. The problem is that some of his separators are not clear to determine where the...

Debugging a third-party DLL in Visual Studio.NET?

Hi, I am using a third party dll. For some particular cases the a function in dll is throwing an exception. I want to know whether it is possible to debug the dll in the visual studio ? Update After the answer from Andrew Rollings , I am able to view the code, but I is there any easy way to debug through the code in visual studio....

How do you put a breakpoint on a memory location in dbx?

A co-worker has a C program that fails in a predictable manner because of some corrupted memory. He'd like to use dbx to monitor the memory location once it's allocated in order to pinpoint the code that causes the corruption. Is this possible? If so what is the syntax to produce a breakpoint at the moment of corruption? If not, what...

Record Application Execution

Hi, I am testing the application in the debug mode under several conditions. Now I'm doing it by writing some of the states and executed functions on the piece of paper and then comparing the scenarios. Does anyone know if there is any built-in functionality in VS2008 or any additional tool that could record the selected states and exe...

How to trace T-SQL function calls

I'm trying to debug a rather complicated formula evaluator written in T-SQL UDFs (don't ask) that recursively (but indirectly through an intermediate function) calls itself, blah, blah. And, of course, we have a bug. Now, using PRINT statements (that can then be read from ADO.NET by implementing a handler for the InfoMessage event), I ...

How do you approach intermittent bugs?

Scenario You've got several bug reports all showing the same problem. They're all cryptic with similar tales of how the problem occurred. You follow the steps but it doesn't reliably reproduce the problem. After some investigation and web searching, you suspect what might be going on and you are pretty sure you can fix it. Problem Unf...

How to I find the calling function name?

I have been using PRETTY_FUNCTION to output the current function name, however I have reimplemented some functions and would like to find out which functions are calling them. In C++ how can I get the function name of the calling routine? ...

how to debug vb6 richtextbox not showing unicode (chinese) properly.

hi there, I have a simple vb6 editor type application which has a richtextbox as the editor page. It allows users to key in stuff and the store it into a file which will keep all the text in RTF stored as CDATA in xml. When you load back the file, it will read it off the xml and load back the rtf. We allow for unicode editing, but my pr...

What's the best way to log debug info in an iphone app?

Is there some standard way or has anyone written something that allows you to log a message and have it be displayed either in a small scrolling section on the iphone screen or in a separate window in the iphone simulator? Update: For noobs like me and don't know, use the NSLog methods as decribed below and make sure you select Run->Con...

How to debug MSBuild Customtask

I'm trying to debug the MSBuild Customtask, that I have just created, but for some reason it never stops at the breakpoint. I've even tried this: public override bool Execute() { System.Diagnostics.Debugger.Break(); And added a break point on that line... I even eliminated all the other code in the method and that did...

What's a good way to debug unit tests written with multiple [Row] attributes?

When I run the following test in Gallio's Icarus it passes, but when I step into it using TestDriven.NET (Test With->Debugger), it fails because the parameters are not set according to the Row attributes. I was expecting that the method would be called once for each Row attribute applied. What am I doing wrong? If nothing, then what do...

Retain Windows Error Reporting Dumps from Hung Application

An application is hanging occasionally, and I would like to see the dump at the time to figure it out. I had written an application that the user can run to automatically create a dump that I can look at. However I can't seem to get the users to remember to run it when it hangs, no matter what I try. They always end up closing the progra...

What is the best way to dump entire objects to a log in C#?

So for viewing a current object's state at runtime, I really like what the Visual Studio Immediate window gives me. Just doing a simple ? objectname Will give me a nicely formatted 'dump' of the object. Is there an easy way to do this in code, so I can do something similar when logging? ...

How to debug a process using Visual Studio?

If an application† crashes: i hit "Debug" and Visual Studio is my currently registered Just-In-Time (JIT) debugger: Visual Studio appears, but there's no way to debug anything: i do not see any disassembly i do not see any registers (assuming it runs on a CPU with registers) the call stack is empty (assuming the CPU has a stack...

Dealing with god objects

I work in a medium sized team and I run into these painfully large class files on a regular basis. My first tendency is to go at them with a knife, but that usually just makes matters worse and puts me into a bad state of mind. For example, imagine you were just given a windows service to work on. Now there is a bug in this service and ...

Possibility to debug from .net code into SQL Server stored procedure code?

Is there any possibility to directly dive into SQL Server stored procedures from .net code? So when debugging step by step in .net, I'd like to step into a called stored procedure. I know how to debug them individually, but I'd like to join these debug sessions in order to gain some time. ...