Updates to FTP publishing in Visual Studio 2010
With VS2010, we introduced “web deployment tool” as the new publish method; at the same time, FTP publish is still available and supported in VS2010. In web application project system, because we centralized main deployment workflow, so some new features usually introducd at the same time with “web deployment tool” is also available to FTP publish. This includes a most important one “web.config transformation”. You can refer Vishal’s post for more detail of how to author transformation files. In this post I will use a simple case to just show how the transformation is wired even you still use publish methods like FTP or plain file system copy.
1. Create a new web application project
2. Expand the “web.config” node (If you create a Visual Basic project, enable “show all files” in the solution explorer), you will see two extra transformation files, “Web.Debug.Config” and “Web.Release.Config”. Note, if you would like to use your existing web application project, you can open it and right click the web.config node in the solution explorer and invoke the menu of “Add Config Transform”. That will create transformation files for each build configuration.)
3. As the “Web.Release.Config” template has the transformation action defined already to remove the “Debug” attribute for the compilation tag in the web.config file, let us switch the solution build configuration to “Release” (through menu of “Build”->”Configuration Manager…”) and use it.
4. Invoke the “Publish” to get the publish dialog opened. Create a profile and select method of “FTP” (you can use publish method of “File System” if you don’t have a FTP site to publish to, and want to try out with a disk path). Fill in the target location path, click “Publish” and wait for it is done. You can open destination site and check out the web.config, and you will see the “Debug” attribute is removed.
Hope it helps. Also as revealed in the project property tab of “Package/Publish”, there is a new setting of “Exclude Generated Debug Symbols” you can configure as well
Yugang Wang | Software Design Engineer | Visual Studio Web Developer