Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 700
GooseZA Avatar asked Aug 26 '14 12:08

GooseZA


4 Answers

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!

like image 108
Mauro Bilotti Avatar answered Sep 28 '22 08:09

Mauro Bilotti


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.

like image 20
Brandon Hawbaker Avatar answered Sep 28 '22 08:09

Brandon Hawbaker


I am using Visual Studio Community 2013.

I had same error:

You can fix it by updating the SQL Server Tools:

Tools --> Extensions and Updates

enter image description here

Then under Product Updates you will see an option to update SQL Server Update.

Click on Update, after it has installed restart Visual Studio.

enter image description here

like image 22
Dawood Awan Avatar answered Sep 28 '22 10:09

Dawood Awan


Try:

  1. Install the latest DacFx from http://www.microsoft.com/en-us/download/details.aspx?id=43370
  2. Reinstall the latest SSDT from http://go.microsoft.com/fwlink/?LinkID=393521

Source: VS2013 SqlBuildTask 04018 Error

like image 31
CSharper Avatar answered Sep 28 '22 08:09

CSharper