开发者

web.release.config change dynamic webservice url

I'm editing my web.release.config file for production. I want the web.config file changed after a publish. I found how to change the web.config by using the web.release.config file properly, but not for this particular component.

The URL of an dynamic webservice has to change.

In the web.config:

<applicationSettings>
    <FooService.Properties.Settings>    
        <setting name="FooService_Student" serializeAs="String">  
            <value>http://testwebservices.foo.bar.nl/Student.asmx</value>  
        </setting>  
        <setting name="FooService_User" serializeAs="String">  
            <value>http://testwebservices.foo.bar.nl/User.asmx</value>  
         </setting>  
    </FooService.Properties.Settings>  开发者_如何学编程
</applicationSettings>

now, how do I change the <value> in both settings? I tried the following, but that didn't work out:

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
    <applicationSettings>
        <FooService.Properties.Settings>    
            <setting name="FooService_Student" serializeAs="String" xdt:Transform="Replace">  
                <value>http://webservices.foo.bar.nl/Student.asmx</value>  
            </setting>  
            <setting name="FooService_User" serializeAs="String" xdt:Transform="Replace">  
                 <value>http://webservices.foo.bar.nl/User.asmx</value>  
            </setting>  
        </FooService.Properties.Settings>  
    </applicationSettings>
 </configuration>

Anyone experience with this matter?

Thankyou!


Add xdt:Transform="Replace" to the applicationSettings tag.

<applicationSettings xdt:Transform="Replace"> 
<FooService.Properties.Settings>     
    <setting name="FooService_Student" serializeAs="String">   
        <value>http://webservices.foo.bar.nl/Student.asmx</value>   
    </setting>   
    <setting name="FooService_User" serializeAs="String">   
        <value>http://webservices.foo.bar.nl/User.asmx</value>   
     </setting>   
</FooService.Properties.Settings>   


How about adding a xdt:Locator="Match(name)", that will probably be what you need to find the exact nodes to replace.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜