Three things to know when using Visual Studio 2008 DSL Tools

In preparing for my presentation at TechEd, I got a chance to try out a couple of new things with DSL Tools on VS2008:

  • The T4 editor from our friends over at Clarius, available at https://www.t4editor.net/. I installed the VS2008 beta 2 version on a VS2008 release candidate and it seemd to work fine. Makes editing text templates much easier. Nice job, Clarius. Can't wait for the other features promised in the future.
  • Using LINQ to write validation constraints. I was blown away by the power of LINQ. Steve has a series of posts about using LINQ for this purpose - well worth a read.

Also for those of you who have wanted to automate the code generation step as part of the build process inside VS, here's a handy hint from one of our own MCS consultants, Jelle Druyts:

Add the following definition to the EnvironmentEvents macro (open Macro Explorer, MyMacros, EnvironmentEvents):

Private Sub BuildEvents_OnBuildBegin(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) Handles BuildEvents.OnBuildBegin
        DTE.ExecuteCommand("TextTransformation.TransformAllTemplates")
End Sub

Then build and it’s done. This will now always transform the templates before any build. Very neat.