April 2008 Entries

T4 Editor update from Clarius coming soon

Just after I'd gone and mentioned that the T4 editor from Clarius Consulting doesn't give you intellisense, Victor Garcia Aprea announces that they're working on an update which does exactly that. Looks really nice too. Pete

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...