Franklin
Franklin

Reputation: 588

VS 2013 SqlBuildTask 04018 Error

After updating to a recent service pack my Database project no longer builds.

I get the following error:

Error 1 04018: The "SqlBuildTask" task failed unexpectedly. System.MethodAccessException: Attempt by method 'Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.OnCreateCustomSchemaData(System.String, System.Collections.Generic.Dictionary2<System.String,System.String>)' to access method 'Microsoft.Data.Tools.Components.Diagnostics.SqlTracer.ShouldTrace(System.Diagnostics.TraceEventType)' failed. at Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.OnCreateCustomSchemaData(String filePath, Dictionary2 referenceMetadata) at Microsoft.Data.Tools.Schema.Sql.Build.SqlTaskHost.CreateCustomSchemaData(String filePath, Dictionary2 referenceMetadata) at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.ProcessReferences(TaskLoggingHelper providedLogger, SqlTaskHost host, ErrorManager errors) at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.LoadImpl(ITaskHost providedHost, TaskLoggingHelper providedLogger) at Microsoft.Data.Tools.Schema.Tasks.Sql.TaskHostLoader.Load(ITaskHost providedHost, TaskLoggingHelper providedLogger) at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteLoadTaskHostStep() at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.ExecuteStep(Func1 step) at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__20.MoveNext() C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets

I have tried rebooting and repairing VS2013 Thanks for any thoughts.

Upvotes: 13

Views: 16265

Answers (4)

ashantiel
ashantiel

Reputation: 72

Ok, solution that worked for me:

I compared dates and versions for files:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SSDT\Microsoft.Data.Tools.Schema.Sql.UnitTesting.targets
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets

and versions from my build machine were one year older than versions from my dev machine. So I copied my dev machine files to build server, and it works...

MSBuild, seriously?

Upvotes: 0

Tresto
Tresto

Reputation: 149

I had to do all of the above and a little extra.

  1. Install the latest service pack for my version of SQL (2012)
  2. Update SSDT
  3. Remove old SSDT files in the new install location
  4. Open project properties and uncheck "Enable extended transact-SQL verification for common objects"
    • Microsoft is removing this from the next version of SSDT and VS

Upvotes: 0

S Mark Courter
S Mark Courter

Reputation: 11

Just updating to the latest SSDT did not work for me.

My Config:

Win 7 Enterprise, VS Express 2013 v12.0.31101.00 Update 4, .NET 4.5.51209

My solution that worked:

  1. Uninstall all prev versions of SQL Server, in my case 2005, 2005 Mobile 2008, Compact Editions, etc. I left 2008 Setup Support Files.
  2. Uninstall SSDT also
  3. Download and install latest SQL Server Data Tools http://msdn.microsoft.com/en-US/data/hh297027 (as of 4/8/15 this is V 12.0.50318.0)
  4. Reload project(s), clean, rebuild and no error!

Upvotes: 1

Mauro Bilotti
Mauro Bilotti

Reputation: 6242

You need to install the last version of SQL Server Data Tools http://msdn.microsoft.com/en-US/data/hh297027

Upvotes: 11

Related Questions