MSDeploy setParameter not working

前端 未结 1 1609
执念已碎
执念已碎 2021-02-19 18:06

We are trying to integrate a \'build once, deploy anywhere\' model in our build-deploy system.

MSDeploy works wonders for this, cutting down build time dramatically with

相关标签:
1条回答
  • 2021-02-19 18:48

    service_Address

    I found the answer to this problem here:

    Replace web.config elements with MSDeploy

    I was missing 'text()' at the end of the XPath expression, the correct XPath is:

    /configuration/applicationSettings/aim.Web.Properties.Settings/setting[@name='ai‌​m_Web_AddressService_Address']/value/text()
    


    customErrorsMode

    For the customErrorsMode problem, I was missing a '/' at the start of my XPath expression. The correct expression is:

    /configuration/system.web/customErrors/@mode  
    


    connectionStrings

    This one really got to me, it was the last one I figured out. After doing a bit of digging I found out that MSDeploy automatically parameterizes certain elements, connection string being one of them, more info here:

    Configuring Parameters for Web Package Deployment

    My parameter declaration for the connection string in question should have been:

    <parameter name="DbConnectionString-Web.config Connection String" defaultValue="">
        <parameterEntry kind="XmlFile" scope="\\web.config$" match="/configuration/connectionStrings/add[@name='DbConnectionString']" />
    </parameter>
    

    My setParameter definition should have looked like this:

    <setParameter name="DbConnectionString-Web.config Connection String" value="Data Source=dbserver;Initial Catalog=DB1;Trusted_Connection=no;User ID=user1;Password=pass*9;" />
    
    0 讨论(0)
提交回复
热议问题