2

Getting error while running build task in VSTS devops.

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets(477,5): Error MSB4062: The "SqlModelResolutionTask" task could not be loaded from the assembly \Extensions\Microsoft\SQLDB\Dac\150\Microsoft.Data.Tools.Schema.Tasks.Sql.dll. Could not load file or assembly 'file:///C:\Extensions\Microsoft\SQLDB\Dac\150\Microsoft.Data.Tools.Schema.Tasks.Sql.dll' or one of its dependencies. The system cannot find the file specified. Confirm that the 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.

barbsan
  • 3,418
  • 11
  • 21
  • 28
dinesh t
  • 31
  • 1
  • 3
  • See if this helps you [Using MSBuild to build SSDT projects with VS2017 fails](https://stackoverflow.com/questions/47440260/using-msbuild-to-build-ssdt-projects-with-vs2017-fails) – Pedro Lopes Apr 26 '19 at 12:21
  • which version of ssdt are you using ? – D.J. Apr 26 '19 at 12:49
  • @D.J. using SSDT2019 – dinesh t Apr 26 '19 at 13:02
  • that version won't with vs2012 – D.J. Apr 26 '19 at 13:24
  • @D.J. Actually I am using VS 2017 i got error during build so i pass the build parameter as 2012 to msbuild – dinesh t Apr 26 '19 at 13:42
  • ok, what error do you get when you don't pass 2012 to msbuild – D.J. Apr 26 '19 at 13:44
  • Getting same error by pointing v11.0 . But at the beginning of build getting warning 'Visual Studio version '15.0' not found.' – dinesh t Apr 26 '19 at 13:52
  • try using "vsbuild"-task instead of "msbuild"-task. the "v15 not found" error is a known issue and has been resolved in task 'vsbuild'. But if you get the exact same error anyway you should check your project-file, there might be v11 hardcoded in there – D.J. Apr 26 '19 at 13:55
  • vsbuild also getting the same error. Earlier it was working fine. Now all the projects getting the same error. – dinesh t Apr 26 '19 at 14:04
  • have you updated either vs or ssdt ? if this worked earlier then something must have changed – D.J. Apr 26 '19 at 14:54
  • No I didn't change anything, after getting error have updated the SSDT. This error occurring only when the DB project is added. – dinesh t Apr 28 '19 at 08:25

2 Answers2

0

Use

/p:StyleCopEnabled=false for .netFramework with msbuild

-p:StyleCopEnabled=false for dotnetcore with dotnet publish

Vamsi J
  • 601
  • 6
  • 8
-1

MSBUILD getting failed with error MSB4062

According to the error messages and the comments you posted, it seems you are build the the project that developed by Visual Studio 2017, but build it with old Visual Studio on Azure Devops.

To resolve this issue, you can try to install the Visual Studio 2017 on your private agent.

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135