-1

My solution has 5 projects and tfs build is working fine. Issue I am having is when I set to deploy from tfs on successful build. Its looking for publish profile in wrong project rather than my startup project. Please Help.

ScreenShot

Update:- So I was able to eventually find what was causing the issue during my build and publish in tfs. Each of the projects that were added in my solution were web applications. And Each of the project had in .csproj file these settings <Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" /> <Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'"> <AspNetCompiler VirtualPath="temp" PhysicalPath="$(WebProjectOutputDir)" /> </Target>. Once I have commented out these in my other applications, the tfs build/publish using my publish profile was not looking for config file that I mentioned in my publish profile. Thanks for your help Patrick.

Sandillio Sandy
  • 27
  • 1
  • 10
  • Could you explain more clearly? Are you working with a web APP? TFS release is using your build artifacts to do the deployment. According to your description, seems there are something wrong with your build artifacts. – PatrickLu-MSFT Jan 23 '18 at 03:01
  • Moreover, what's the result if you do the publish in local use Visual Studio? – PatrickLu-MSFT Jan 23 '18 at 03:02
  • @PatrickLu-MSFT Sorry if I didn't explain myself clearly. Yes I am working with a web application in MVC6 and my VS publish to the server works fine. And these are my build arguments /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=$(build.stagingDirectory) /p:Configuration=$(BuildConfiguration) /p:CreatePackageOnPublish=true /p:DeployOnBuild=true /p:PublishProfile=$(PublishProfile). – Sandillio Sandy Jan 23 '18 at 19:01
  • And this is the error I am getting C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets (4359, 5) The value for PublishProfile is set to 'DEVAPP1DEBUG.pubxml', expected to find the file at 'D:\Agents\xyz1-5\_work\19\s\proj.Domain\Properties\PublishProfiles\DEVAPP1DEBUG.pubxml' but it could not be found. Instead it should just look for in proj. – Sandillio Sandy Jan 23 '18 at 19:08

1 Answers1

0

Suggest you first manually remote to your build agent and double check if there are corresponding DEVAPP1DEBUG.‌​pubxml file located at the path on the build agent.

According to your description, maybe there are something wrong in your build artifacts for deployment. Suggest you try this way, looking into the TFS options for Build Definitions and when you have to select a template for the definition, you can see two options Build and Deployment, try with the Deployment option :

enter image description here

and by default in the MSBuild Arguments the parameter is :/p:OutDir="$(build.binariesdirectory)\\" enter image description here

In that folder you should have everything need for the deployment.

PatrickLu-MSFT
  • 44,639
  • 4
  • 24
  • 52
  • @PatrickLu_MSFT I tried to follow this https://stackoverflow.com/questions/16891530/publish-one-web-project-from-solution-with-msbuild as its the same issue I am having but still getting the error. Here is the screen shot https://i.stack.imgur.com/L01hg.png – Sandillio Sandy Jan 25 '18 at 19:04
  • @SandillioSandy This may related to your publish profile name. Have your double check this Take a look at the comment in this thread: https://johandorper.com/log/publish-multiple-webprojects-on-build Sorry, could not reproduce your issue, what's the result if you directly use msbuild command to build and publish your solution in the build agent manually not through TFS build definition. This will narrow down if the issue is related to TFS build side or not. – PatrickLu-MSFT Jan 26 '18 at 15:52
  • @SandillioSandy "My Solution has many web projects.Could I can build solution and deploy single web project ? " "You could set up publish profiles with different names. So for example, make a publish profile of "SingleDeploymentProjectA" where ProjectA is the name of the single project you want to deploy. Then you could just have a TFS build definition for building them all which uses your standardized "Development" publish profile name, and then one for single deployment where the publish profile is "SingleDeploymentProjectA"" – PatrickLu-MSFT Jan 26 '18 at 15:52