4

hostHeader can be set in ServiceDefinition.csdef file as

<Site name="Web">        
  <Bindings>
    <Binding name="Endpoint1" endpointName="Endpoint1" hostHeader="www.mysite.com"/>          
  </Bindings>
</Site>

How can I change this setting according to my project configuration?

e.g. when my project is published in debug mode, hosetHeader should be set to test.mysite.com, and when project is published in release mode, hostHeader should be set to www.mysite.com

David Makogon
  • 69,407
  • 21
  • 141
  • 189
ajay_whiz
  • 17,573
  • 4
  • 36
  • 44

1 Answers1

2

We use Visual Studio 10 config transformations. To get transformations working with Azure configs, see this answer.

Community
  • 1
  • 1
Jonathan McIntire
  • 2,665
  • 23
  • 26
  • I followed the steps you mentioned in the link. When I try to publish, I get a warning `ServiceDefinition.Staging.csdef(2,2): warning : No element in the source document matches '/ServiceDefinition'` . What could be the problem? – ajay_whiz Jun 27 '11 at 10:44
  • 2
    @ajay_whiz I recently ran into this problem with our ServiceDefinition.csdef tranformation. To resolve it, I added a sd namespace to the ServiceDefinition node: ... ... – Jonathan McIntire Jun 27 '11 at 15:26
  • it worked!! I checked in RoleModel.xml file in package file it is correctly set as expected. Thanks – ajay_whiz Jun 27 '11 at 15:49
  • @ajay_whiz Cool! Happy transforming. ;-) – Jonathan McIntire Jun 27 '11 at 15:53