Archive for the ‘.net’ Category

Two Components for your Toolbox

Posted on September 25th, 2009 by aaron
Filed under .net, Uncategorized | 2 Comments

Any desktop application I write from now on will contain these two interfaces. They’re useful enough I thought I should share. Also note, with upcoming improvements in .NET 4.0 (or higher) they might be rendered moot. So far, I don’t think they are, as it’s still difficult to test the code itself that performs asynchronous [...]

Say Hello to My Little Internet

Posted on August 20th, 2009 by aaron
Filed under .net, services | No Comments

Recently I’ve been thinking about options for exposing an application automation API for inter process integration scenarios. For example, a desktop application that exposes the ability for other applications to programmatically query information from it and/or invoke commands. I also had a few requirements. Whatever I choose should:

Let me inject core application services (or higher [...]

Debugging UI

Posted on December 15th, 2008 by aaron
Filed under .net, debugging, windows forms | 7 Comments

I’ve talked before about System.Threading.SynchronizationContext, as well as BeginInvoke/InvokedRequired/IsHandleCreated. In a multi-threaded Windows Forms application they can easily be mis-used, introducing difficult to find bugs.
One such not-so-subtle bug (application hang) is particularly nasty, and is described fairly well here. Distilled down, the application hangs, usually when the computer comes out of sleep mode, unlocks, or [...]

Case insensitive string comparisons with LINQ Dynamic Query

Posted on December 15th, 2008 by aaron
Filed under .net, tips and tricks | 6 Comments

LINQ rocks. It really does.
One down-side to LINQ is that, out of the box, it’s geared towards knowing your query structure at compile-time. The values can be dynamic, of course, but it’s assumed that the structure of your query is static. For example, if you want to select a set of "Person" objects from the [...]

Testing TempData, and Mocking SessionState

Posted on March 12th, 2008 by aaron
Filed under .net, asp.net, asp.net mvc | No Comments

About a month and a half ago Ben Scheirman wrote about testing TempData in ASP.NET MVC. It’s good stuff, and aside from changes between Preview 1 and Preview 2, it still works fine. (See Scott Hanselman’s post for some Preview 2-friendly mock helpers using Rhino Mocks.)
While I can easily understand what Ben’s code is doing, [...]

S3 Browser for Windows Live Writer

Posted on March 10th, 2008 by aaron
Filed under .net, blogging, tools | 2 Comments

Tim Heuer announced today the release of “S3 Browser”, a plug-in for Windows Live Writer that enables easy inserting of links or images from your S3 storage. See his announcement on his blog, and on the Code Trip’s blog.
Like Tim, I’ve been using S3 to host my images for the blog, and I wholeheartedly agree [...]

Refactoring C# with PowerShell

Posted on January 4th, 2008 by aaron
Filed under .net, powershell, programming | 4 Comments

Visual Studio 2005 and 2008 have built-in support for refactoring code, including renaming namespaces, classes, variables, and more. Add-ins like Resharper also have support for refactoring by renaming. These tools work great, and have good integration into the Visual Studio IDE, for example being able to preview each change and exclude false positive matches. I [...]

Symbol Store Manager – open source and a beta release

Posted on December 30th, 2007 by aaron
Filed under .net, Symbol Store Manager, debugging, powershell | No Comments

A while ago I "released" the Symbol Server Transaction Manager. It was a binaries-only, quick-and-dirty GUI wrapper utility I wrote on top of the symstore.exe command-line tool, at the prompting of John Robbins. If you’re not familiar with Symbol Servers, symstore.exe, or John Robbins, get up to speed by reading John’s still-relevant 2002 Bugslayer article [...]

Loading “collocated” file dependencies at runtime

Posted on December 12th, 2007 by aaron
Filed under .net | 1 Comment

Best quote this year, from an internal email thread this morning:
‘Just Say No’ to collocated file dependencies at run time.
Loading file dependencies (like images, etc.) at runtime in a dynamic way can be tricky without resorting to a global information store like the registry. How do you know where your .NET application is “executing from”? [...]