Answered IIS 7 connection string problem on TFS 2010 build completion

  • Friday, August 03, 2012 10:46 AM
     
     

    Hello All

    I have a build definition that is triggered every time someone in my team checkins in their code. I have the builds folder location mapped in IIS so that the solution is accessible on our intranet to everyone. However IIS website starts throwing connection string problems whenever the build is triggered either automatically or manually. I know its the connection string because if I go into IIS -> Sites -> Default web sites -> MY SITE NAME -> Connection strings (on the right) -> ApplicationServices and rewrite the (almost) same connection string the website starts functioning again. When I edit the connection string instead of using custom I use the SQL server route which also masks the password in the custom string (first image), however every time a new build is created it comes back to custom string (image with red hidden password). Even the strings are a little different. I am attaching what it automatically places and what I put in after writing.

    Can someone please shed some light as to what might be happening here. Also is there is a better way to do what I am doing here?

    Thanks a lot.

    Best

    Sajat

All Replies

  • Tuesday, August 07, 2012 7:11 AM
    Moderator
     
     

    Hi Sajat,

    Thanks for your post!

    Can you tell me what do you mean the "builds folder location "? Do you mean the build drop location?

    If yes, why do you not use a UNC path based on localhost? You typically create a public drop folder on a file-sharing server in TFS 2010 so that your team can access outputs such as those from nightly builds.

    Please perform the following steps to set up a drop folder:

    1. Log on to the computer where the drop folder will reside.

    2. Open Windows Explorer, and browse to the folder that contains or will contain the drop folder.

    3. If necessary, create the drop folder.

    4. Right-click the folder, click Properties, and then click the Sharing tab.

    5. On Windows Server 2008, Windows 7, and Windows Vista only: Click Advanced Sharing.

      The Advanced Sharing dialog box appears.

    6. Select Share this folder, and then click Permissions.

      The Permissions for FolderName dialog box appears.

    7. Click Add.

      The Select Users, Computers, or Groups dialog box appears.

    8. Perform one of the following steps, depending on what type of account has been specified as the build service account:

      • NETWORK SERVICE running on the computer that contains the drop folder: In the Enter the object names to select box, type NETWORK SERVICE.

      • NETWORK SERVICE running on a different computer from the one that contains the drop folder:

        1. Click Object Types.

          The Object Types dialog box appears.

        2. Select the Computers check box, and then click OK.

        3. Verify that the location is correct.

        4. In the Enter the object names to select box, type BuildMachine$ where BuildMachine is the name of the build machine on which the build agent is running.

      • A domain account: Verify that the location is correct. In the Enter the object names to select box, type the name of the account.

    9. Click OK.

    10. In the Permissions for FolderName dialog box, click the account that you just added to the Group or user names list.

    11. Select the Change and Read check boxes, and then click OK.

    For more information, you can refer to http://msdn.microsoft.com/en-us/library/bb778394(v=vs.100).aspx

    If I misunderstand you, please feel free to let me know!

    Best Regards,


    Cathy Kong [MSFT]
    MSDN Community Support | Feedback to us

  • Tuesday, August 07, 2012 9:33 AM
     
     

    Hi Cathy,

    Thanks for replying. However creating a publicly available drop folder is not my question. Ours is a web application so we want it run on IIS as well to test its functionality across multiple platforms and browsers. The part where TFS builds our solution whenever its checked in is working fine but I don't understand as to what could be happening that creates the need to write the same connection string again in IIS (please see attached screenshots above).

    Thanks for the help.

    Best

    Sajat

  • Monday, August 13, 2012 7:01 AM
    Moderator
     
     

    Hi Sajat,

    Thanks for your feedback!

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some tiome delay. Appreciate your patience.

    Thank you for your understanding and support.

    Best Regards,


    Cathy Kong [MSFT]
    MSDN Community Support | Feedback to us

  • Wednesday, August 15, 2012 4:45 PM
    Owner
     
     Answered

    There is a better way of deploying a web site to an IIS server during Team Build - valid only when you are using Team build 2010 and above.

    In order to be able to publish your web site during build you will have the follow these steps:

    1. On the server that will host your application you'll need to install the Web Deployment Tool. You can download the Web Deployment Tool from the following URL
    http://www.iis.net/download/WebDeploy

     

    2.  Creating a Build Definition to work with MSDeploy


    The important part from the above is the MS Build arguments that you need to pass


    They will look something similar to the following:

    /p:DeployOnBuild=True /p:DeployTarget=MsDeployPublish /p:MSDeployServiceURL=http://localhost /p:DeployIISAppPath="Default Web Site/SimpleWebDeployTest" /p:CreatePackageOnPublish=True /p:MsDeployPublishMethod=InProc /p:AllowUntrustedCertificated=True /p:UserName=AspUser /p:Password=myPass$word

    In case you deploy to a local host:  MsDeployPublishMethod=InProc
    In case you deploy to a remote host:   MsDeployPublishMethod=RemoteAgent

    For more info please see:

    http://blogs.msdn.com/b/dfaoliveira/archive/2012/06/03/deploying-asp-net-application-using-web-deployment-tool-service-passing-no-credentials.aspx


    Trevor Hancock (Microsoft)
    Please remember to "Mark As Answer" the replies that help.