Monthly Archives: September 2012

WCF & useless ProtocolException

Imagine we have a program which uses WCF services. Sometimes your WCF service stops to work and you are getting such exception on a client. I find this exception absolutely useless. ‘The first 1024 bytes’… There are no useful information … Continue reading

Posted in Uncategorized | Tagged , | 5 Comments

T4 Runtime Template and code-behind logic

By default T4 runtime template adds to the project corresponding generated cs file But what if we want to have some custom logic in separate C# file? We create a partial class and put that logic there. But default project … Continue reading

Posted in Uncategorized | Tagged | Leave a comment

Useful Dictionary extensions I am always using

There are some of methods I am always creating from scratch for all projects I am working on

Posted in Uncategorized | Tagged | Leave a comment

[T4] Assembly references for Design-time templates

Generally assemblies in T4 added via Assembly directive MSDN detailed description Common snippets:

Posted in Uncategorized | Tagged | Leave a comment

T4 Design-Time templates base class

Let’s discuss how to provide a custom base class for design-time T4 templates. If we can do that it will open us a way to extend T4 templates and add as many features as you wish. First of all let’s … Continue reading

Posted in Uncategorized | Tagged | 1 Comment

T4 Templates and Null in Expression block

Another annoying issue with T4 templates is its support for nulls. If you have template Both design-time and runtime templates will fail with And this is very annoying because sometime you are calling external functions and you don’t want to … Continue reading

Posted in Uncategorized | Tagged | 1 Comment

T4 Runtime Templates Base Class

Unfortunately out of the box T4 Runtime templates in Visual Studio have some issues Let’s discuss these issues one by one. Issue with base classes When we create RuntimeTextTemplate1.tt Visual Studio automatically generates nested C# file which contains RuntimeTextTemplate1 and … Continue reading

Posted in Uncategorized | Tagged | Leave a comment