开发者

Best Approach for autopublishing Webapplications

Can you please tell what are the best approaches for doing auto publishing of webapplications using vs2010 and team city. Currently trying to do by adding a web deployment project, Is 开发者_C百科it best way to do or there are some other option to do same.


By web deployment project I presume you mean the projects with the ".wdproj" suffix. These have been superseded in VS2010 by Web Application Projects which carry the 'normal' project file extension (e.g. .csproj) and are far simpler to build and deploy, regardless of which CI system you're using.

Specifically, in TeamCity you could set up a build configuration with a build step that contains the following Runner properties:

  • Build Runner: MsBuild Build File
  • Path: "MyWebAppProjectDir\MyWebAppProj.csproj"
  • MSBuild version: 4.0
  • Targets: Rebuild;Package

This builds the site and all its dependency projects and packages it to a subdirectory as a ZIP file in "MyWebAppProjectDir\obj\Debug\Package\".

You can then create a subsequent build step to deploy the packaged ZIP to a local or remote web server. This is done using the Command Line build runner with the following command executable:

MyWebAppProject.deploy.cmd /m: DestinationServerName

Note that this may require a one-off installation of the deployment agent service on your target server, depending on the version of IIS you are using and the preferred authentication method. More details on that here: http://msdn.microsoft.com/en-us/library/ff356104.aspx

If you prefer to watch it being done, here's some recommended viewing on Web Deployment Projects from MIX10, although it doesn't show how to set it up in TeamCity specifically: http://channel9.msdn.com/events/MIX/MIX10/FT14

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜