Visual Studio 2013: Database Project MSBuild error

2019-01-22 05:24发布

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.

13条回答
乱世女痞
2楼-- · 2019-01-22 05:34

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

查看更多
戒情不戒烟
4楼-- · 2019-01-22 05:35

I had Visual Studio 2013 Update 5 installed and was having this issue. I followed these steps from above and that fixed the issue for me -->

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

查看更多
姐就是有狂的资本
5楼-- · 2019-01-22 05:35

If it helps anybody, I installed VS2014 CTP 3, and I can build from it. Interestingly after a successfull build in vs2014, the next time you build in VS2013 it works. But subsequent builds in VS2013 dont work, until you rebuild in VS2014.

查看更多
混吃等死
6楼-- · 2019-01-22 05:37

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.

查看更多
\"骚年 ilove
7楼-- · 2019-01-22 05:37

I was able to fix the issue by repairing Microsoft SQL Server Data Tools and re-starting Visual Studio 2013. Control Panel > Right Click: "Microsoft SQL Server Data Tools" > Click: "Repair" > Re-Start Visual Studio

查看更多
登录 后发表回答