VS 2013 SqlBuildTask 04018 Error
Asked Answered
C

4

13

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.

Countryman answered 17/9, 2014 at 19:43 Comment(1)
Duplicate Question here - you may like to keep your eye on it.Tobey
E
11

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

Erythroblast answered 10/12, 2014 at 13:53 Comment(0)
S
1

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!
Synclastic answered 10/4, 2015 at 17:28 Comment(0)
D
0

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
Daedal answered 16/7, 2015 at 11:47 Comment(0)
R
0

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?

Retinitis answered 24/9, 2015 at 12:45 Comment(1)
Oh... This is also mentioned here: link as an answer to duplicate question.Retinitis

© 2022 - 2024 — McMap. All rights reserved.