0
votes

Under TFS 2015 under command line step I have : C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.com

Under Arguments: "MuSolution.sln" /build $(BuildConfiguration)

Where Release is configured build into ..\bin\ and Debug is configured to ..\bin\Debug\

I checked and the

$(BuildConfiguration)

is release and it builds for release On Publish Build Artifacts step Root is specified as $SomeRootFolder\MySolution where the bin folder gets written to

Contents are:

/bin/**
/MySolutionApp/Web.config
/MySolutionApp/Global.asax
/MySolutionApp/ApplicationInsights.config

Artifact MySolution

Artifact Folder gets created with nothing there.

I have tried **\bin** but everything including Debug folder gets written.

I need to have Artifact in this layout:

MySolution\bin
/MySolution/Web.config
/MySolution/Global.asax
/MySolution/ApplicationInsights.config

Any help would be appreciated.

3
Why do you use command line to build your project? How's your build definition like?Cece Dong - MSFT

3 Answers

0
votes

First off, use the Visual Studio Build step -- it's designed to run Visual Studio properly.

Secondly, you'll need to pass in appropriate MSBuild arguments for your web application. /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\" is a common set that will bundle up the application as a web deploy zip file.

/p:OutDir=$(build.artifactstagingdirectory) /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true should put an uncompressed version in $(Build.ArtifactStagingDirectory).

You may need to tweak these parameters a bit to get exactly what you want.

0
votes

**\bin\** copies all files recursively from any bin folder. You could try the following match patterns:

**\bin\$(BuildConfiguration)\**

MySolutionApp\Web.config

MySolutionApp\Global.asax

MySolutionApp\ApplicationInsights.config
0
votes

In MysSolution.sln and in startup project created a publishing profile MyReleasePublishProfile with Release and Any CPU set along with Target Location where to drop Bin and rest of the files.

In TFS 2015 created MSBuild Visual Studio step and pointed at my solution MySolution.sln solution and set Restore NuGet Packages: Checked Configuration : Release

Advanced: MSBuild Version MSBuild Version Latest MSBuild Architecture MSBuild x64

MSBuild Arguments to:

/p:DeployOnBuild=true /p:PublishProfile=MyReleasePublishProfile

Hope this helps people like me who wanted a way to build this out.