asp.net - Web Deploy deleting IIS website custom configuration -


i'm using web deploy (from vs2013) publish asp.net mvc site iis 7.5.

i added url rewrite rules , custom http response headers through iis manager.

the problem everytime deploy new version of site, configuration deleted.

is expected behaviour or there wrong? how can keep these custom settings on each deploy?

update

so understood need put these changes in web.config. i'm trying put them in web.release.config it's not being added deployed web.config. guess i'm missing xdt:transform rule.

this got in web.release.config (yes, publishing profile using release config).

<configuration>     <!-- other stuff -->     <system.webserver>         <rewrite>           <rules>             <rule name="redirect www" patternsyntax="wildcard" stopprocessing="true">               <match url="*" />               <conditions>                 <add input="{http_host}" pattern="mydomain.com" />               </conditions>               <action type="redirect" url="http://www.mydomain.com/{r:0}" />             </rule>           </rules>         </rewrite>       </system.webserver> </configuration> 

turn build action of web.config none. prevent file being deployed each time publish.

edit

for inserting entire sections web.config web.release.config, need xdt:transform="insert" added so:

<system.webserver xdt:transform="insert">         <rewrite>           <rules>             <rule name="redirect www" patternsyntax="wildcard" stopprocessing="true">               <match url="*" />               <conditions>                 <add input="{http_host}" pattern="mydomain.com" />               </conditions>               <action type="redirect" url="http://www.mydomain.com/{r:0}" />             </rule>           </rules>         </rewrite>       </system.webserver> 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -