1
votes

I want to use the TFS Build server. I want the build server to build related projects, publish and deploy to other servers.

I have set up the server and build agent. It is time to define build definitions. But I have a problem here.

We use VS 2015 and we have a big solution. It includes many dll projects, web sites and a WCF project.

I want to define build definitions for each web sites seperatly. for example when I run build definition A, it should only publish website A. And I do not want to build the whole solution to publish website A. Only necessary projects should be built.

How can I do this ?

Thanks for your help.

1
Are you using vNext build or Xaml based build?Angshuman
ok instead of specifying the .sln file try to specify the csproj file, but you will need to change a lot in the Msbuild command.Angshuman
can you give example or source ?Çağatay
Give me some time. I might be wrong here.Angshuman

1 Answers

2
votes

i have finally found a solution.

  • Firstly, i added VisualStudioBuild Task,
  • set Solution Path variable to the .csproj file that i wanted to build and publish,
  • set Repository and cloak unnecessary projects,
  • set MSBuild Arguments as;

    /p:OutputPath=bin/$(BuildConfiguration)
    /p:DeployOnBuild=True
    /p:DeployTarget=MSDeployPublish
    /p:MsDeployServiceUrl=https://xxx:8172/MsDeploy.axd
    /p:AllowUntrustedCertificate=true 
    /p:DeployIisAppPath="Default Web Site/xxx" 
    /p:MSDeployPublishMethod=WMSVC 
    /p:CreatePackageOnPublish=True 
    /p:UserName=xxx
    /p:password=xxx
    

The important argument is OutPutPath here. If you do not give this property and try to build a csproj, msbuild throws exception.