Article From:
cause: our team now uses Visual Studio 2013 to develop projects and use tfs2013 to do it.Source code management, every morning manually release project files, copy to the test server’s site folder to cover old files, using this way to publish the system, even a number of times a day. Low efficiency and hard work.
asp.netProject release.
automatic release system configuration process:
  • Environmental inspection
    1. Client: Visual Studio 2013 development environment, able to connect to the source server (TFs TFs 2013), and get the source code of the check-in project.
    2. Source code server (TFs 2013)
    3. The server (IIS) is able to access normally, and can use project files to cover the old files under the site folder and visit them normally.
    • Configuring web deploy Publishing
    1. IISInstall the configuration “management service”
      Refer to the second part of this article: teletext detailed remote deployment of ASP.NET MVC 5 project.  
    2. Download and install the web deploy, and recommend the use of “fully installed”. Pay attention to the order of installation: “web deploy” after “management service”. If it is back, “web deploy” needs the last run installer to use the modification function, and finally do it.”Complete installation”.
    3. Test web deploy, using https://IP:8172/MsDeploy.axd This address tests WebDeploy, if the user name password dialog box is popped up, it means that “web deploy” has been installed successfully. You don’t have to wait to see the result.
    4. Using the web deploy release in the visual studio 2013 project, the project to IIS site was successfully released. Such
       Refer to the third part of this article: teletext detailed remote deployment of ASP.NET MVC 5 project.
      This step is crucial to continue the cornerstone of the next step. Attention: pay close attention to the pubxml in the following pictures, and release the configuration files. This is the key to the system.
    5. Add the configuration and test of files that need to be added and excluded when publishing.
      For example, exclude web.config files and fonts folders:
      The complete pubxml file is as follows:
      <?xml version=”1.0″ encoding=”utf-8″?> 
      The publishing / packing process of your Web project will use this file. You can edit this MSBuild file
      From the behavior that defines the process. To learn more about this information, please visit LinkID=208121. It
      <Project ToolsVersion=”4.0″ xmlns=”″> 
      <LastUsedPlatform>Any CPU</LastUsedPlatform> 
      <RemoteSitePhysicalPath /> 
      <Objects xmlns=””> 
      <ObjectGroup Name=”DefaultConnection” Order=”1″ Enabled=”False”> 
      <Destination Path=”” /> 
      <Object Type=”DbDacFx”> 
      <PreSource Path=”Data

      Security=True” includeData=”False”
      dacpacAction=”Deploy” /> 
      <UpdateFrom Type=”Web.Config”> 
      <Source MatchValue=”Data Source=(LocalDb)\v11.0;Initial

      <!– Expelled some files or folders –>
      <MSDeployParameterValue Include=”$(DeployParameterPrefix)DefaultConnection-Web.config Connection String”> 
      Reference technical literature:Be used forCommon problems of Web application project deployment for Visual Studio and ASP.NET

    • Configure TFs automatic release
    1. tfsInstall “generate configuration”
    2. No need to set up
    3. tfsThe machine is installed with web deploy
    4. Copy visual”C:\Program Files of the studio 2013 computer(x86) \MSBuild\Microsoft\VisualStudio “folder” to “TFs” in the machine phase.The same catalogue. You can back up the old directory in advance. If this step is not performed, there will be an error in missing files.
    • Configure the auto generated configuration file
      Open the project (team project) of visual studio 2013 and click generate. The following is an important part of the screenshot.

      The MSBuild parameter in the previous picture is /p:DeployOnBuild=True; PublishProfile=webapp01; AllowUntrustedCertificate=true; Pas.Sword=pwd
      This parameter is the key part of automatic release. PublishProfile=webapp01 is the name of the pubxml file. See the first picture in this article. Password=pwd is the password for IIS to issue the user, and the user name is in.In the pubxml file.

    • At this point, all configuration is completed.
    • test
      Modify the project files and check in, the system will automatically compile and publish.
    if you want to execute unit tests before the compilation and release, you can’t use the” default template “in the” process “, and use the custom build process template

    Leave a Reply

    Your email address will not be published. Required fields are marked *