1

I am trying to implement continuous integration with SQL Server 2014 as my target database.

My publish.xml file looks like this

TargetConnectionString>Data Source=~~~~~~~~;Integrated Security=True;Pooling=False

And my build definition file looks like this

Items to build --> Build $/First Project/Database1/Database1.sln with default platform and configuration

MSBuild Arguments --> 
/t:Build /t:Publish /p:SqlPublishProfilePath=Database.publish.xml /p:VisualStudioVersion=12.0

But when I queue my build, it fails with below weird error.

C:\a\bin\Database1.publish.sql: The source file 'C:\a\src\DB Project\Database1\Database.publish.xml' could not be opened ('The system cannot find the specified file. ').

Not sure why is it pointing to C:\a\src path whereas my project is located in a different location.

If you have any suggestion to fix this issue, please let me know.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Nisarg
  • 11
  • 3

1 Answers1

0

You often see this with CI builds - the c:\a\src is normally done by the build server (what build server are you using?)

Either the xml file is not being included in the build (unlikely) or you just need to adjust the path to the file.

Have a look on the build server and see what folder the file is actually under, then adjust the path you see until it can get to it, a little example might help to explain!

MSBuild is taking the path Database.publish.xml and adds it to the working directory so you get:

C:\a\src\DB Project\Database1\Database.publish.xml

but if you look on that machine, maybe the file is actually in:

C:\a\src\DB Project\Deploy\Database.publish.xml

so to fix it in your msbuild arguments you would change the path to:

/p:SqlPublishProfilePath=..\Deploy\Database.publish.xml

This all really depends what folder the file is in and so you just need to find a way to get to it!

Ed Elliott
  • 6,666
  • 17
  • 32
  • I am using XYZ.visualstudio.com. If I put full local path then getting this error "MSBUILD : error MSB1008: Only one project can be specified with database.publish.xml". If I put "/t:Build /t:Publish /p:SqlPublishProfilePath=..\Database.publish.xml/p:VisualStudioVersion=12.0" then I am getting following error C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets (1356): Cannot evaluate the item metadata "%(FullPath)". The item metadata "%(FullPath)" cannot be applied to the path "..\Database.publish.xml/p:VisualStudioVersion=12.0". – Nisarg May 02 '15 at 01:06