Getting build error after selecting "automatically deploy the database project before unit tests are run" checkbox in SSDT visual studio 2022

Abhinay 51 Reputation points
2022-12-15T12:34:08.593+00:00

In new visual studio update “Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.4.3”,
After selecting the “automatically deploy the database project before unit tests are run” checkbox in SQL Server Test Configuration, when I tried to run the SQL unit test case I got the build error

    C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VisualStudio\v17.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(425,5): error MSB4062: The "SqlModelResolutionTask" task could not be loaded from the assembly C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\SQLDB\DAC\Microsoft.Data.Tools.Schema.Tasks.Sql.dll. Method 'get_BuildEngine' in type 'Microsoft.Data.Tools.Schema.Tasks.Sql.SqlBuildTask' from assembly 'Microsoft.Data.Tools.Schema.Tasks.Sql, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' does not have an implementation. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.  
  

Visual studio SQL Server Test Configuration option Screenshot
271083-image.png

Visual studio error Screenshot
271091-image.png

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,886 questions
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,354 questions
Visual Studio Testing
Visual Studio Testing
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Testing: The act or process of applying tests as a means of analysis or diagnosis.
337 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,782 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 29,446 Reputation points Microsoft Vendor
    2022-12-16T08:53:12.573+00:00

    Hello @Abhinay ,

    Thank you for taking time to post this issue in Microsoft Q&A forum.

    I did some tests and I could reproduce your issue. I have submitted a ticket on our Developer Community for further investigate, here’s the link: Failed to deploy database project. Please kindly follow up that thread and if there’s any updated information I will update here.

    Thanks for your understanding and thanks for helping us make VS better.

    Sincerely,
    Tianyu

    • If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
    1 person found this answer helpful.