Main Page

Main Page

Preview Handlers for Vista and Outlook 2007

Really useful for those xml files that people send you. Download the MSDN Magazine Preview Handlers and then setup the xml file with this really cool utility. It gives explorer and outlook preview capabilities for all sorts of file types.

T4 Templating in C#3.0 / .Net 3.5 and its uses in DSL development

Cut to the chaseOK. So you just want to know how to do it? Modify your template directives to the following. <#@ template inherits="Microsoft.VisualStudio.TextTemplating.VSHost.ModelingTextTransformation" language="C#v3.5" #> What?..Why? Recently I have been doing a lot of work in Microsoft's Domain Specific Language Tools for Visual Studio. In fact for the past 8 months this has pretty much been my main focus. I've learned a lot of things on the way and it occurred to me that the development of T4 templates used in DSL tools would be made a lot easier with the use of extension methods. To understand why,...

WCF Exceptions and Fault Contracts

I ran across an issue recently trying to get a custom exception across a WCF boundary. The trouble is, WCF does not like to tell you what the problem was, and for good reason. I was thinking about exceptions the wrong way. In reality we do not want to pass exceptions across a WCF service boundary, instead we want to pass a Fault back to the caller. An exception is a CLR concept, it does not make sense to expose this outside of the CLR, despite the fact that an exception contains potentially dangerous information (like the stack trace) which...

What is a comfortable office temperature?

Its 27 degrees Celsius today in our office and it feels like an oven. One of the guys has hooked up a digital multi-meter as a thermometer, you have to love geeks.

Concatenating Delimited Strings with Generic Delegates

I knew this must be possible through generic delegates and eventually found this really useful post by Phil Haack which describes using a generic delegate Join method to concatenate strings. Saves a lot of ugly code if you are using T4 or A-N-Other templating language to produce code from a  Dsl or schema.

Windows Live Writer

Finally the latest version of windows live writer seems to work with my blogging engine. Seems they have made some updates to allow blogware engine support for categories etc. Or maybe I just missed these on previous releases. Anyhoo, looks good.

Visual Studio 2008 RTM'd

....and commence downloading. http://weblogs.asp.net/scottgu/archive/2007/11/19/visual-studio-2008-and-net-3-5-released.aspx http://blogs.msdn.com/somasegar/archive/2007/11/19/visual-studio-2008-and-net-framework-3-5-shipped.aspx  

TFS: Work Item Search

I've been using this plugin now for the past few months. You would not believe the difference it makes. This plugin puts a little search box right into Visual Studio to make it easy to find work items.  It is an addin for Team Foundation Client (Team Explorer) and is accessible from the Team menu when you're connected to a Team Foundation Server and is also avalible from a VS Toolbar.  You just type in some search text and it runs a work item query for you showing you results across the work item store. Source: Codeplex project "Search Work Items"

HeadMelter of the week - Self-Constrained Generic Base Classes

Melted my own brain for a few hours with this one today. Essentially a self-constrained generic base class looks like the following.     public class MyEntity : EntityBase<MyEntity> {     }   This allows me to put some generic implementations in a base class for code that I would simply duplicate otherwise. For example:       public class EntityBase<T> : IEquatable<T>, IComparable<T>     {         public int CompareTo(T other) {             // Insert compare code here           }           public bool Equals(T other) {             // Insert Equality Code Here         }     }   Enjoy!

WCF: Custom Collections with Extra Payload

I came across a pretty annoying problem to solve in WCF today. Suppose you have a custom collection of items you wish to use in a WCF contract but it also has extra properties that you have added, for example change tracking.     [Serializable]     public class DtoCollection<T> : List<T>     {         private List<T> addedItems;         private List<T> removedItems;     }   It will serialize the collection fine but your added properties and fields will not appear. The [CollectionDataContract] attribute will not help you. If you look at this really great post from Sowmy Srinivasan's blog you can see the order of preference for WCF serialization markup....

Full Main Page Archive