Visual Studio 2013: Database Project MSBuild error

I've got a database project as part of my solution in Visual Studio 2013. Been working perfectly for the last 3 weeks and now suddenly today it won't build and so I cannot publish any changes. I'm getting an MSBuild error:

"C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(513,5): Error: MSB4018: The "SqlBuildTask" task failed unexpectedly. System.MethodAccessException: Attempt by method 'Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.OnCreateCustomSchemaData(System.String, System.Collections.Generic.Dictionary`2)' to access method 'Microsoft.Data.Tools.Components.Diagnostics.SqlTracer.ShouldTrace(System.Diagnostics.TraceEventType)' failed."

Anyone got any ideas? All I did this morning was pull down the latest changes from source control. I can't see how that would mess up the actual MSBuild process, and the guy who checked in last doesn't have any issues at all.


You need to install the last version of SQL Server Data Tools:

http://msdn.microsoft.com/en-US/data/hh297027

Make sure to restart VS and then build the solution again. This solves the problem!


In Visual Studio 2013 -> Tools -> Extensions and Updates... -> Updates -> Product Updates -> Microsoft SQL Server Update for database to 12.0.50318.0

I was upgrading from 12.0.41012.0 and this resolved my issue. This relates to the answer to install the latest SQL Server Data Tools.