locked
TFS build / deploy doesn't really deploy MSBuild Exception RRS feed

  • Question

  • Hi all,

    I'm trying to get TFS 2010 and MSBUILD to deploy my website to a test server.   The build runs and displays in TFS as successful, but the deploy never actually happens.

    I copied  pasted the full command line below:

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe /nologo /noconsolelogger "C:\Builds\15\CP\MyBuildName\Sources\WebApplication.sln" /m:1 /fl /flp:"logfile=C:\Builds\15\CP\MyBuildName\Sources\WebApplication.log;encoding=Unicode;verbosity=detailed" /p:SkipInvalidConfigurations=true /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:MsDeployPublishMethod=WMSVC /p:CreatePackageOnPublish=True /p:AllowUntrustedCertificate=True /p:MSDeployServiceURL=https://MyWebBox:8172/msdeploy.axd /p:DeployIISAppPath=MyWebsiteName /p:UserName=something /p:Password=something /p:OutDir="C:\Builds\15\CP\MyBuildName\Binaries\\" /p:Configuration="Release" /p:Platform="Any CPU" /p:VCBuildOverride="C:\Builds\15\CP\MyBuildName\Sources\WebApplication.sln.Any CPU.Release.vsprops" /dl:WorkflowCentralLogger,"c:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Detailed;BuildUri=vstfs:///Build/Build/1667;InformationNodeId=1431372;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;TFSUrl=http://mytfsbox:8080/tfs/Chs;"*WorkflowForwardingLogger,"c:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Detailed;"


    If I run this manually from the command line on my build machine, I get this error message:

    MSBUILD : error MSB1025: An internal failure occurred while running MSBuild.
    System.InvalidOperationException: Cannot dispose the build manager because it is not idle.
       at Microsoft.Build.Execution.BuildManager.Dispose(Boolean disposing)

    If I remove everything that's underlined, the build does not crash, and deployment works.  So how can I override / prevent this setting?


    This signature unintentionally left blank.


    • Edited by Nick F. _ Wednesday, August 6, 2014 4:26 PM
    Wednesday, August 6, 2014 4:19 PM

All replies

  • Hi,

    In fact, when deploy website, only the command line below MSBuild use.

    /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:MsDeployPublishMethod=WMSVC /p:CreatePackageOnPublish=True /p:AllowUntrustedCertificate=True /p:MSDeployServiceURL=https://MyWebBox:8172/msdeploy.axd /p:DeployIISAppPath=MyWebsiteName /p:UserName=something /p:Password=something

    Could you please tell me how you manually run the command line on build machine?

    >>If I remove everything that's underlined, the build does not crash, and deployment works.

    Do you mean you run the full command line that you pasted with MSBuild and it fails? Then you run the command line without the underlined command and it runs ok?

    As far as I know, the underlined information is generated by TFS automatically.  

    I suggest you using the command line above to deploy the website project.

    Please feel free to let me know the result.

    Best regards,

     


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, August 8, 2014 7:21 AM
  • RE: Do you mean you run the full command line that you pasted with MSBuild and it fails? Then you run the command line without the underlined command and it runs ok?

    Yes this is exactly what I mean.  MSBuild crashes with the full command.

    RE: Could you please tell me how you manually run the command line on build machine?

    First, I ran the build definition in TFS with detailed logging enabled.

    I connected to the build server via RDP, and opened "Visual Studio Tools/Developer Command Prompt for VS2013" Then I copied/pasted the entire command from the TFS build log into the open prompt and executed it.  Running this way I received the indicated exception.

    After that I kept repeating the command, omitting different parameters and observing the results until it deployed successfully.

    RE: I suggest you using the command line above to deploy the website project

    The deploy command entered into the build definition is exactly as you've posted.


    This signature unintentionally left blank.

    Monday, August 11, 2014 1:10 PM
  • Hi Nick F,

    Thank you for your details!

    I think I can totally get you now.

    You tried to get TFS 2010 to deploy my website to a test server. The build runs and displays in TFS as successful, but the deploy never actually happens. Then you use MSBuild command line to deploy the project. And the project can be deployed successfully when you delete the underlined command line.

    I'm glad to analyse this issue with you. Since you can build the project successfully, I think MSBuild command line is ok. And you can use MSBuild command line to deploy the website successfully that confirms this view. As we know, the underelined content is automatically generated by VS. We can see the meaning of the underlined command.

    /dl equals /distributedlogger

    meaning: Log events from MSBuild, attaching a different logger instance to each node. To specify multiple loggers, specify each logger separately.

    It is a switch for loggers. It is not the key point of deploying a website. The essential command is DeployOnBuild, DeployTargetPublishMethod, CreatePackageOnPublish, AllowUntrustedCertificate, UserName and Password. 

    So the reason you can't deploy the website is the configuration issue of TFS, I think. Anyway, I suggest you post this issue in TFS forum because it is a TFS issue and I'm not familiar with it.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Anna Cc Friday, August 22, 2014 6:05 AM
    Friday, August 22, 2014 6:03 AM
  • I'll certainly cross post the problem, however it can be argued that the problem lies within the msbuild.exe code.

    The error message states: Cannot dispose the build manager because it is not idle.

    If the build manager code is smart enough to know when it's not idle, it should be smart enough to wait until it's finished before exiting.


    This signature unintentionally left blank.

    Friday, August 22, 2014 12:39 PM
  • Hi Nick F,

    As we all know, the error information doesn't match the real cause sometimes. 

    You can read the thread below.

    http://social.msdn.microsoft.com/Forums/vstudio/en-US/d15f5efa-fbff-4336-8910-de8136b04a40/visual-studio-2012-rtm-project-failing-multiprocessor?forum=msbuild

    Quixoteprog came acorss the same error with you after upgrade TFS.

    At last, this error disappear when they run the same build in a comparable hardware machine.

    When we set up a comparable hardware machine and ran the same build through TFS build agents on that the build ran much faster (12-15 minutes down from several hours) as expected, and the error mentioned above disappeared.  We have run several builds with large, multi-project solutions with multi-proc turned on and they all complete quickly and with no problems.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, August 26, 2014 6:52 AM
  • Thanks. I read the thread and I'm not quite sure it applies given that our system is still running TFS 2010.

    Also, based on investigation, the issue seems to be related to distributed logging associated with the build.  I say this because eliminating distributed logging eliminates the exception.


    This signature unintentionally left blank.

    Tuesday, August 26, 2014 5:54 PM
  • Hi Nick F,

    It sounds like your thinking is right. To be honest, I'm not familiar with the TFS part. Since eliminate distributed logging eliminates the exception, you can delete the automatically generated command line to deploy the project to see if it can work.

    Best regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Sunday, August 31, 2014 10:51 AM