I setup a new build in VSTS this week and started receiving the following error during my CI build after adding a SQL Database project to my solution:
(SPP-CreateDeployCommand target) ->
MSDEPLOY : error Code: ERROR_SCRIPTDOM_NEEDED_FOR_SQL_PROVIDER [D:\a\1\s\myDatabase.csproj]
MSDEPLOY : error count: 1. [D:\a\1\s\myDatabase.csproj]
For deployment of my database I’m using the MSDeployAllTheThings.SqlDeploy Nuget package which creates a WebDeploy package of the DACPAC from my database project. Visual Studio doesn’t support adding Nuget packages to database projects so you have to add a class library project to add the package and handle the deployment. This deployment project fails with the above error during the build. The actual database project builds without issue.
I couldn’t find anyone else who had seen this problem in TFS/VSTS but several who had seen this error locally because they didn’t have SSDT installed or their SSDT install had become corrupted. So I added the following Nuget packages to my deployment project:
But still no luck.
Looking for Help
Ultimately I opened up two forum posts to try to get some help.
I created an example in Github to more easily reproduce the error as well. After further discussions with some Microsoft folks on Twitter it appears this is a bug on the Hosted agents. Not sure what priority this is for them but hopefully they will fix it soon.
Workaround
Until then you can use a private agent with VS2017 Community edition installed. I started with just the VS2017 build tools but it appears they don’t include the SQL Data Tools assemblies.
Vote It Up
If you are also hitting this error make sure to go show your support for the fix on the Developer Community page:
If you found this post helpful/informative, have further information or have seen different results, please leave a comment below and share with the community.