Beckshome.com: Thomas Beck's Blog

Musings about technology and things tangentially related

Redgate Reflector Pro

As many of you likely know, Lutz Roeder turned over control of one of the “must have” .NET developer tools, .NET Reflector to Red Gate software. True to their promise, RedGate has continued to support the free version of Reflector and make continued improvements, including the addition of a Visual Studio plugin to jump into Reflector and the support of .NET 4 assemblies with their most recent release of the tool.


Lightweight, Aspect-Oriented Instrumentation with PostSharp, NLog, and SQLite

How would you like to achieve detailed exception and trace logging, including method timing and correlation all within a lightweight in-memory database that you can easily manage and query, as exhibited below?

.NET Logging Output

All of this requiring nothing more of you than simply decorating your methods with a very simple attribute, as highlighted below.

.NET Attribute Usage

In this post, I’m going to demonstrate how to configure PostSharp, an aspect-oriented framework, along with NLog and SQLite to achieve the benefits highlighted above. Before I get into the details of the configuration and aspect source code, I’ll provide a bit of background on PostSharp.


Watch Out! .NET Web Services and the XML Serializer

Sometimes you know that something works a certain way but you haven’t really internalized it, you haven’t grok’ed it, until you experience it firsthand. Such was my knowledge of the interaction between .NET web services and the XML Serializer a couple of weeks ago.

While troubleshooting calls made from a smart client to back-end web services, I was using Process Monitor to see what was going on under the hood. It didn’t dawn on me at first why I was seeing dynamic generation of temporary C# files and compilation of these files using the C# compiler (csc.exe) as shown in the image below. Since the services in question were provided by a legacy mainframe and were necessarily granular and immutable, the client application was generating a lot of new proxies, meaning a lot of wasted time.


Book Review: Ultra-Fast ASP.NET

I picked up this gem of a book when it first came out in eBook format during the PDC. I sent it over to my Kindle and got through the entire book during session downtimes. I planned on being the first to post a review of this book on Amazon but I’ve sat it out too long and will now be the fifth review.

Ultra-Fast ASP.NET

The first four reviewers did a pretty respectable job of providing and overview of Mr. Kiessig’s qualifications and the book content and have all awarded the book the entirely deserved 5 start rating. Rather than pile on more information about Rick Kiessig or what’s in the book, I’m going to tell you why, as a person who has spent a good amount of time looking at .NET application performance, I recommend this book to every person I work with as mandatory reading:


SQLite and .NET - Agility Tips and Tricks

For quick and easy prototypes, you’ve got to admire ASP.NET MVC and WCF RIA Services. These approaches may not be perfect out-of-the-box but they’re structured much better than the old “bind a dataset to a grid and let it fly” approach of 2003. As easy as these approaches are, I’m always looking for ways to make things easier. I get a lot of bang for my buck by using SQLite as an in-memory database whenever I create a new MVC or RIA Services solution. In fact, I create 4 SQLite databases with each new solution: one each for application data, test data, membership/role data, and logging/tracing data. Below I’ve described the techniques I make use of to utilize each of these databases.


Microsoft Service and Integration Technologies - WCF 4.0, AppFabric, BizTalk 2010

One of the things I’m often asked to do for clients is to create an applicability matrix. That is, which technology applies best to which particular challenges in an enterprise? There would seem to be an acute need for this type of clarification in the realm of Microsoft’s service technologies. With the recent releases of Web Process Activations Services (WAS) on Windows Server 2008, WCF 3.5 and 4.0, Windows Server AppFabric, BizTalk 2009 and 2010, and Windows Azure AppFabric, the waters of Microsoft’s service and integration technologies is muddy indeed. In this post, I’m going to provide some clarification; explaining what new service and integration offerings are on the way from Microsoft, offering a frame of reference on how I see them applying to enterprise customers, and furnishing references to materials you can use to educate yourself in these technologies.


PowerBuilder and .NET

I’ve had the opportunity to spend the last week or so investigating a system integration challenge involving PowerBuilder and .NET communicating with web services hosted on a mainframe. It’s been an interesting experience that’s enabled me to dive deep into .NET and to learn a bit about where PowerBuilder is at and where it’s heading. My outtakes follow:

  • What’s .NET got to do with it? I was totally perplexed at first when I got asked to assist with a challenge integrating a PowerBuilder client with mainframe web services. I saw .NET in the middle of the diagram but was perplexed “what’s .NET have to do with a PowerBuilder client-to- mainframe integration?”


WCF Concurrency and Instancing

I’ve been ranting to some colleagues about a particularly useful table that showed the interactions between WCF’s InstanceContextMode and ConcurrencyMode behaviors. I referenced it in a conversation again today and decided that I needed to go hunt down the phantom table so that it haunted me no longer.

I thought the table was in Lowy’s Programming WCF Services. Full attribution to Essential Windows Communication Foundation: For .NET Framework 3.5, one of my other favorite WCF books. I’ve copied the table below so that I can refer to it by hyperlink forever more.


Logging to SQLite with NLog

This is one of those seemingly trite blog entries – unless you’re actually trying to integrate System.Data.SQLite with NLog, in which case it’s invaluable. SQLite and NLog really are the perfect combination for lightweight logging. You avoid the sprawl of file-based logs over time, can execute SQL queries against your logs and have an absolutely minimal database footprint to deal with. If only you can get the configuration correct…

The NLog documentation provides some hints to get you going in the right direction for database-based logging. However, no matter how much spelunking I did around the Net, I couldn’t find a definitive answer on how to configure NLog to use SQLite. The configuration file that worked for me can be found below. Exact mileage may vary based upon your project setup. This should get you 95% of the way there though. Happy logging!


Microsoft's Guide to Claims Based Identity and Access Control

Three months after the PDC conference and I’m finally catching up on the reading materials I collected in LA. One of the books I picked up was a copy of the Patterns and Practices Group’s A Guide to Claims Based Identity and Access Control. It turns out that this book just RTM’ed and is now available online in PDF and HTML formats.

Claims Based Identity and Access Control

This book is unique in the Microsoft world. You can find all kinds of books that scratch the surface of application and web service security. If you’re looking to dive deep and understand Claims-based identify and federated security, you were relegated to piecing bits of information from blogs, MSDN, and other sources – until this book arrived. The books takes a topic that is complex and difficult to comprehend and approaches it from the perspective of several personas: a security specialist, software architect, developer, and operations manager. While this is by no means an O’Reilly Heads-First style book, the persona approach, professional illustrations, simple metaphors, and meaningful examples go a long way towards making the material much more digestible.