-
I've been doing a lot of static analysis on our projects at work lately. As part of that task we added NCover to our automated build process. Our build runs on Team Build (TFS) and is specified in an MSBuild file. We wanted to take code metrics very seriously and we purchased the complete version...
-
Today I needed a way to identify ANSI (Windows-1252) and UTF-8 files in a directory filled with files of these two types. I was surprised to not find a simple way of doing this via a property of method somewhere under the System.IO namespace. Not that it's that hard to identify the encoding programmatically...
-
In the spirit of helping the next guy, here's some explanation for a problem that was surprising to me. We have recently upgraded our product to 64-bits and all developer workstations to Windows 2008 x64. The transition was easy and most things worked with minor or no tweak at all. We're still...
-
My current project has an interesting story of being converted across platforms and programming languages. I hope I can talk about this conversion process some day (it was not manual). One of the side effects of mass conversions like this is that the final result tends to carry over some weird patterns...
-
The other day I came across this post in Marteen Balliauw's blog where he demonstrates and interesting way to make the same ASP.NET MVC view render correctly from both a regular request and an Ajax request. In Marteen's post he uses a custom ActionFilterAttribute to detect the Ajax call and replace...
-
Still in the topic of performance, I'll throw a little freebie. Visual Studio seems to take an inordinate amount of time to open .aspx files for the first time. I noticed that the status bar read "Initializing toolbox..." for a long time. I'm mentioning .aspx but it really applies to...
-
A friend of mine was telling me about a bug he found in one of his applications caused by a simple lack of escaping quotes when producing CSV files. It immediately reminded me of an old trick in .NET. If you really want, you can create CSV files using ADO.NET and OLE-DB (or ODBC.) I wouldn't necessarily...
-
I'm about to configure a new development machine this week. It's going to be my 3rd install from scratch in the last 12 months, which I know is not all that much, but certainly more than I wish I had to. Besides the common software development tools, like Visual Studio, SQL Server, Ruby, Office...
-
I know, this is probably not news to anyone. TimeSpan is the native .NET type to represent time intervals. But answer quickly, SqlCommand.CommandTimeout represents the interval in milliseconds, seconds, or minutes? What about System.Timers.Timer.Interval ? To circumvent this situation we see all sorts...
-
We are working on SQL 2008 for a new project with the intent to leverage the new data types , in this case especially the HIERARCHYID data type. One of the stored procedures we created had a parameter of type HIERARCHYID . The code that calls the stored procedure was something like this. SqlHierarchyId...
-
A few months ago, when I installed Visual Studio 2008 on my system, I opened one of my projects, did the usual project conversion, edited some files, created a few others, saved, tested, and checked in source control. Another developer working on the same project, also with VS2008, later edited some...
-
Since I started using Visual Studio 2005 and now 2008 it bugs me that strings in the debug windows (Immediate, Watch, Locals, Autos, etc) are automatically escaped in C# syntax (well, at least in C# projects.) Let's assume we are writing some code that produces HTML (or XML, or SQL, or JSON, etc...
-
At work one application has this intermittend problem that started when the developer started to use telerik's r.a.d. web controls. Once in a while, for some (until today) unexplained reasons, the telerik controls would start throwing this error: This control is complied for ASP.NET 1.x. Please use...
-
How to Create Windows Services It's not uncommon for an enterprise application to need some form of background processes to do continuous work. These could be tasks such as Cleanup abandoned shopping carts Delete temporary files left behind by some report or image generation feature Send email notifications...
-
I may very well be the last one to figure this one out, but I always thought that the Edit and Continue option in Visual Studio 2005 and 2008 was a myth. I always made certain that the Enable Edit and Continue check-box was firmly checked, as shown below, but I had never gotten the feature to work. With...