If you write code to SQL Server then you might be interested in this: at the end of 2017 I wrote a tSQLt tdd training course which has helped over 300 people learn both tSQLt and how to apply TDD practices to their SQL Server T-SQL development, you can join the course at https://courses.agilesql.club. The course is free if you are happy to wait 10 weeks to complete it, with 1 lesson being made available per week - if you are in more of a hurry or you would like to help support the project you can purchase the course which makes it instantly available to you.

ScriptDom versioning issues

I installed the 2016 SSMS client recently and in one way or another any of my apps that I have written that use the DacFx ScriptDom have all broken in slightly different ways. One app throws a type conversion error and another just failed to find any statements in a batch.

When I started debugging the problem I noticed that I got this when I started one of the apps from Visual Studion:

No way to resolve conflict between “Microsoft.SqlServer.TransactSql.ScriptDom, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91” and “Microsoft.SqlServer.TransactSql.ScriptDom, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91”. Choosing “Microsoft.SqlServer.TransactSql.ScriptDom, Version=13.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91” arbitrarily.

I looked into it some more and because the ScriptDom is in the GAC, .Net ends up choosing the highest version available which in this case is a) a beta and b) not the version my app was created using.

To fix it I changed the properties of the reference in my project to be version specific:

Set the reference to ScriptDom.dll to be version specific

If you can’t rebuild your app for some reason then you can use the app.config to force it to stay at the correct version:

https://msdn.microsoft.com/en-us/library/7wd6ex19(v=VS.100).aspx (or if the url changes search for “Redirecting Assembly Versions”.