Debugging a process that cannot be invoked through Visual Studio.

Sometimes it is rather difficult to debug through Visual Studio directly even although the project is right there in front of you. In my case I have an assembly that is invoked from a wrapper that is itself invoked from an MSBuild script. I could potentially get VS to invoke the whole pipeline but it …

Changing the default Assembly/Namespace on an MVC appliction

TL;DR When getting an error message like this: Compiler Error Message: CS0246: The type or namespace name ‘UI’ could not be found (are you missing a using directive or an assembly reference?) when compiling Razor views after changing the namespace names in your project, check the web.config file in each of the view folders for …

A better tracing routine

In .NET 4.5 three new attributes were introduced. They can be used to pass into a method the details of the caller and this can be used to create better trace or logging messages. In the example below, it outputs tracing messages in a format that you can use in Visual Studio to automatically jump …

Parser Error Message: Ambiguous match found

Symptom On deploying a newly precompiled web site, the error message as displayed by ASP.NET is as follows: Server Error in ‘/’ Application. Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser …

Tip of the Day #17: Duplicate input fields

Don’t allow duplicate input fields into your form. The other day I was trying to debug a bug in an application that I maintain. The code created a set of pagination buttons at the top of the page with previous and next buttons. At some point a request had come in that the buttons needed …

Errors like these drive me insane

Today I was trying to fix up a website for one of our clients. I got the site out of source control but somehow or other it wouldn’t compile. I’m not going to talk about the fact it didn’t compile out of the box – We all know that is not a good situation and …

Tip of the Day #7 (SysInternals)

I’ve visited the SysInternals site a few times over the course of my career because of some strange problem that I just couldn’t track down. The amount of information about what is actually happening on your system that the SysInternals tools provide is phenomenal. The site was run by Mark Russinovich and Bryce Cogswell until …

The Conditional attribute in .NET

One of the odd thoughts that shoot across my brain today was how does Debug.Assert() work? I mean there are not separate debug and release builds of the .NET Framework so how does it know what sort of build it is? A quick look in reflector revealed that Debug.Assert is defined as: [Conditional(“DEBUG”)] public static …