Visual Studio automatically generates a transform file for both the release and debug configurations. You can see these by clicking "Show All Files" and expanding the web.config. The transform file is just a set of rules telling the publish profile how to change the web.config for that configuration. A simple example is below:
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.serviceModel>
<client>
<endpoint name="TheWebServiceName" address="http://www.thisisfake.com/FictionalService.svc" xdt:Transform="SetAttributes" xdt:Locator="Match(name)" ></endpoint>
</client>
</system.serviceModel>
</configuration>
Our web application calls a web service that is at a different URL in production than in our development environment. Above is a simple example of a transform file that changes the address attribute of the endpoint element when the name matches "TheWebServiceName".
No comments:
Post a Comment