Database project build errors in TFS with Visual Studio 2015 Update 3 - tfs

I have a solution containing a web application and multiple database projects. While using the old XAML definition, I can compile and generate the database deployment files in TFS. With the new definition introduced in TFS 2015, I can only generate the web application deployment files.
Here are parts of the log -
2016-10-28T22:14:48.6892904Z Build started 10/28/2016 4:14:48 PM.
2016-10-28T22:14:48.8883071Z 1>Project "E:\TFS\agent\_work\1\s\Test.Client.sln" on node 1 (default targets).
2016-10-28T22:14:48.8893071Z 1>ValidateSolutionConfiguration:
2016-10-28T22:14:48.8903071Z Building solution configuration "release|any cpu".
2016-10-28T22:14:49.0633142Z ##[warning]E:\TFS\agent\_work\1\s\..\Databases\Test\Test.DB.Test.sqlproj.metaproj(0,0): Warning MSB4046: Error reading project file "..\Databases\Test\Test.DB.Test.sqlproj": Could not find a part of the path 'E:\TFS\agent\_work\1\Databases\Test\Test.DB.Test.sqlproj'.
2016-10-28T22:14:49.0643150Z 1>Project "E:\TFS\agent\_work\1\s\Test.Client.sln" (1) is building "E:\TFS\agent\_work\1\s\..\Databases\Test\Test.DB.Test.sqlproj.metaproj" (2) on node 1 (default targets).
2016-10-28T22:14:49.0693159Z 2>E:\TFS\agent\_work\1\s\..\Databases\Test\Test.DB.Test.sqlproj.metaproj : warning MSB4046: Error reading project file "..\Databases\Test\Test.DB.Test.sqlproj": Could not find a part of the path 'E:\TFS\agent\_work\1\Databases\Test\Test.DB.Test.sqlproj'.
2016-10-28T22:14:49.0823182Z 2>Done Building Project "E:\TFS\agent\_work\1\s\..\Databases\Test\Test.DB.Test.sqlproj.metaproj" (default targets).
I could not find much information on the new build definition. Anyone can help?
Thanks

We figured out what is wrong with this. Our database projects are in another folder. We need to map the server path with the local path in the Build's repository. After added this, the database project can be built.

First double check the difference of your two definitions XAML and vNext.
And check the file path E:\TFS\agent\_work\1\s\..\Databases\Test\Test.DB.Test.sqlproj on the build agent, if there are the corresponding file.
And try to build your database project directly instead of building the whole solution to see if there are some useful info for troubleshooting.
Update
Tips:
You can also build MSBuild project (.*proj) files.
If you are building a customized MSBuild project file, we recommend you use the MSBuild step instead of the Visual Studio Build step.
Source Link: Visual Studio Build

Related

MSBuild not copying files with PublishProfile

I have a Visual Studio 2013 solution with the full Orchard source code. When I use "Publish..." on the "Orchard.Web" project in Visual Studio, it correctly publishes the site to the File System destination I've configured into the .PubXml file that I used.
However, if I build this site using Jenkins, the files do not get copied to the destination. I've created a separate PubXml file that is used by Jenkins.
In my Jenkins job, I have two Build steps of interest. The first uses the src\Orchard.sln file with a command line argument of /p:Configuration=Release. This runs correctly, and builds the entire solution.
The second Build step, immediately after, uses the Build File of src\Orchard.Web\Orchard.Web.csproj and these command line arguments:
/p:DeployOnBuild=true
/p:PublishProfile="D:\workspace\Site\trunk\src\Orchard.Web\Properties\PublishProfiles\Jenkins.pubxml"
/p:VisualStudioVersion=12.0
/p:Configuration=Release
/p:Platform=AnyCPU
/v:minimal
/nologo
/p:WarningLevel=1
With this, the build and deploy seems to work - but doesn't. Here are some lines from the build output:
Copying all files to temporary location below for package/publish:
obj\Release\Package\PackageTmp.
Auto ConnectionString Transformed obj\Release\Package\PackageTmp\Shapes\Scripts\Web.config into obj\Release\CSAutoParameterize\transformed\Shapes\Scripts\Web.config.
(... about 200 more "Auto ConnectionString..." lines...)
Finished: SUCCESS
No where does it actually copy the files to the destination defined in the PUBXML file.
In contrast, in Visual Studio, the output looks similar, but transforms only 4 config files and includes lots of "Publishing folder x" lines:
(...)
Transformed Modules\SH.GoogleAnalytics\web.config using ....
Copying all files to temporary location below for package/publish:
obj\Release\Package\PackageTmp.
Publishing folder /...
Publishing folder bin...
(etc.)
(I have installed the latest Windows Azure SDK for .NET on the Jenkins server.)
I have the same trouble,that work for me:
/t:Rebuild
/p:DeployOnBuild=true
/p:PublishProfile=Jenkins_Publish
/p:Configuration=Release
do not use /p:VisualStudioVersion=xxx
This is kind of old, but I actually just set up Orchard to be able to get built via command line and MSBuild. Here is what I did:
/p:VisualStudioVersion=12.0;PublishProfile="example-profile";DeployProjA=true;FrameworkPathOverride="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v4.5";Configuration=Release;PublishProfileRootFolder=c:\Workspace\src\Orchard.Web\Properties\PublishProfiles;Password=ExamplePass
Since you are using Orchard you want to make sure that only the Orchard.Web project gets published so do not use DeployOnBuild=true. This will attempt to deploy every web project in the solution, which is a lot for Orchard. Instead follow the guidelines here to see how to deploy only the web project: http://sedodream.com/2013/03/06/HowToPublishOneWebProjectFromASolution.aspx

Can I Override WebDeploy archive paths through TFS Build?

My team is starting to take on the challenge of automating our Build-Deploy-Test process, beginning with the build.
Right now we have Build Definitions configured in TFS that will publish our site to our servers using Web Deploy, and this is working; however, we aren't able to keep an archive of the packages that would be created with each build because when we turn on package creation with the MSBuild parameter /p:CreatePackageOnPublish=true, the build fails on silly NTFS file length constraints.
Exception Message: TF400889: The following path contains more than the allowed 259 characters: \\builds.tfs.company.com\builds\Project.Dev.Nightly\Project.Dev.Nightly_20130630.6\Debug\_PublishedWebsites\Project.Middleware.Service_Package\Archive\Content\C_C\Builds\1005\Project\Project.Dev.Nightly\Sources\Source\Multi\Middleware\Project.Middleware.Service.
Is there a way that we can break the Archive folder out somewhere else?
You can edit the path by using the _PackageTempDir argument for MSBuild.
Just add _PackageTempDir=D:\{desired dir structure} when you're passing in MSBuild arguments.
More full explanation of this property can be found here -
VS2010 Web Deploy: how to remove absolute paths and automate setAcl?

TFS 2010 Build Definitions only output DLLs and PDBs?

So, I'm new to TFS build definitions - and the RA team at my company asked how to deploy a project that I built. In this case, a Windows Service project.
When I compile from Visual Studio, the "bin" directory has all the files I need... including copying a ".bat" file that is set to "copy local".
Anyway, the last step of the default "Build Definition" is "Run MSBuild for Project"... but that seems to just stick every DLL in the entire solution into an output directory.
Am I missing something? ... how do I get the build to:
Only build a single project - not the entire solution.
Put all the files that would be in the "bin" directory into the output directory.
When you're editing the Build Definition you can specify just a single project if you wish. By default TFS Build should put everything in the Build Drop that you typically find in your bin directory.
If you find the build is missing files that you expect to be there consult the MSBuild log that you can find linked from the TFS Build log. You can also run the TFS Build with Verbosity=Diagnostic when you queue up a build, which will cause the MSBuild log to contain much more detail.
Dylan Smith's answer was correct, and got me 90% there... the was a strange bug that some quick Googling found here: http://social.msdn.microsoft.com/Forums/uk/tfsbuild/thread/990fdd96-69bc-4e99-be0e-acc0874e022f
So, the solution is:
Do what Dylan said (pick the csproj file).
Remove the "Any CPU" part of the build... just target "Release" or "Debug" or whatever.

Error While Creating Build

I have TFS 2010 and for one of the team project I have created the build definition (used default build template) and added the solution of one of the project. But when try to create build getting the following error:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets
(902): The command "if Debug == Debug copy
"C:\Builds\14\\\Sources\ServerObjects..\SharedInterfaces\bin\debug*.dll"
"C:\Builds\14\\\Sources\ServerObjects..\ServerObjects\bin\debug"" exited with
code 1.
I think you maybe has wrong folder structure on the source control, see my answer on similar question here
teambuilding and deploying a dll (e.g. wpftoolkit.extended.dll)
TeamBuild overrides the output folder so the bin\debug (or bin\release) folder won't exist. It collates the output into Binaries.
For your custom build step use the obj folder instead of bin as that'll be the same under both TeamBuild and the local machine build.

Build Installshield project using TFS build

I am working on Installshield and TFS (VSTS 2008) and now I want to build Installshield 2011 Project along with build definition.
For this I have created build.proj file which contains build definitions to build .sln projects which is working fine.
Now at end of Build definition file I have added like this :
<Target Name="AfterCompile">
I have added the reference of Installshield project, so that after building Visual Studio projects start building Installshield projects at the end:
<Exec Command=""$(DevEnvDir)\Common7\IDE\devenv" E:\Sw\Manual_Build_TFS_R3\Setup.isproj /Build"/>
Earlier I have used VSINSTALLDIR in palce of DevEnvDir still error will come which says
Task "Exec"
Command:
"\Common7\IDE\devenv" E:\Sw\Manual_Build_TFS_R3\Setup.isproj /Build
The system cannot find the path specified.
E:\BuildSource\Temp\BuildType\TFSBuild.proj(444,5): error MSB3073: The command ""\Common7\IDE\devenv" E:\Sw\Manual_Build_TFS_R3\Setup.isproj /Build" exited with code 3.
Done executing task "Exec" -- FAILED.
Done building target "AfterCompile" in project "TFSBuild.proj" -- FAILED.
Done Building Project "E:\BuildSource\Temp\BuildType\TFSBuild.proj" (EndToEndIteration target(s)) -- FAILED.
Build FAILED.
"E:\BuildSource\Temp\BuildType\TFSBuild.proj" (EndToEndIteration target) (1) ->
(AfterCompile target) ->
E:\BuildSource\Temp\BuildType\TFSBuild.proj(444,5): error MSB3073: The command ""\Common7\IDE\devenv" E:\Sw\Manual_Build_TFS_R3\Setup.isproj /Build" exited with code 3.
0 Warning(s)
1 Error(s)
I am new to this VSTS and TFS build configurations.
We use something like this:
Command=""%programfiles%\Microsoft Visual Studio 8\Common7\IDE\devenv" ..."
Would that work for you?
-- EDIT --
Another thought that came to mind is the suggestion that you consider WIX instead of InstallShield. WIX projects work really well within MSBuild.
I can't think of any valid reason that the path to your InstallShield project should be hard-coded as it appears in your question.
Can you build the *.isproj file from the command line with MSBuild? If so, then you could just add it to your solution and set it up to only build for a new solution configuration that you use in your TFS build.

Resources