DACPAC build failing with "System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Tools.Schema.Sql, Version=15.0.0.0"

Answered

Hi, I have a feeling that this is an error with the build tools, rather than TeamCity, but if you could provide any help with this, it would get me 'unstuck'.

I have a VS 2019 SQL Server Database project that builds on a local machine. When I try to build under TC, I get the error:

error MSB4061: The "SqlModelResolutionTask" task could not be instantiated from "C:\BuildTools\SSDT\Microsoft.Data.Tools.Msbuild\lib\net46\Microsoft.Data.Tools.Schema.Tasks.Sql.dll". System.TypeInitializationException: The type initializer for 'Microsoft.Data.Tools.Schema.Tasks.Sql.DataTask' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Data.Tools.Schema.Sql, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. at Microsoft.Data.Tools.Schema.Sql.Extensibility.ToolingShim.ConfigureExtensions() at Microsoft.Data.Tools.Schema.Sql.Extensibility.ToolingShim.SetupTooling() at Microsoft.Data.Tools.Schema.Tasks.Sql.DataTask..cctor() --- End of inner exception stack trace --- at Microsoft.Data.Tools.Schema.Tasks.Sql.DataTask..ctor() at Microsoft.Data.Tools.Schema.Tasks.Sql.SqlModelResolutionTask..ctor()

SSDT was missing from the build server and doesn't have a standalone 2019 installer (that I could find), so I used the 2017 SSDT installer, which could be the issue. I can't find where the reference to the 15.0.0.0 dll is coming from.

Thanks

Richard

0
3 comments

Hello Richard,

Indeed, it appears to be a tool issue; we have a good article on how you could check whether the issue is environment-specific or is an issue with TC itself - https://www.jetbrains.com/help/teamcity/common-problems.html#Build+works+locally+but+fails+or+misbehaves+in+TeamCity

Could you also to try and execute the build with Diagnostic verbosity, upload the build log to https://uploads.jetbrains.com and send over the upload ID? Perchance it will highlight where the reference comes from.

0

Hi Fedor, it was missing the 2019 SSDT build tools. Installing those fixed the last of our issues with this

Thanks for your help

Richard

0

Richard,

Thank you for notice! It`s definitely curious it was asking for 15.X one with 2017 tools, though.

0

Please sign in to leave a comment.