visual studio - web.debug.config Transform not working -


i don't know i'm doing wrong, feel i've tried everything. can't seem web.config of project transform web.debug.config changes. read someplace transformation takes place when being published. read slowcheetah handle this, installed project. doesn't make difference either.

running vs 2012 express. debug using iis express local server installed vs. run firefox browser.

web.config:

<appsettings>   <add key="siteurl" value="http://development.mysite.com/" /> </appsettings> 

web.debug.config:

<appsettings>   <add key="siteurl" value="http://localhost:4652/"       xdt:transform="setattributes"       xdt:locator="match(key)" /> </appsettings> 

i've tried using replace:

<appsettings>   <add key="siteurl" value="http://localhost:4652/"       xdt:transform="replace"       xdt:locator="match(key)" /> </appsettings> 

when running in debug configuration locally:

string siteurl = configurationmanager.appsettings["siteurl"]; 

still results in siteurl being http://development.mysite.com/

i've ran preview transform right clicking on web.debug.config , shows transform being made perfectly, not when run web application locally.

have admit, don't see how configure slowcheetah. don't see way configure , i've been thinking maybe "something" on own. :s

does know how overcome or if might doing wrong?

i'd suggest ignoring slow cheetah moment because don't think need it. i've used windows forms development, haven't had need web development. instead use standard 1 click web deploy mechanism, , rethink how use config transforms.

basically, utilize transforms when publishing, , put local development settings in main web.config instead of transform.

  1. then if have lab/test/sandbox environment want publish create solution , project configuration environment.

adding new solution configuration in configuration manager

  1. next right click on web.config , click add config transform add config transform solution configuration created.

adding config transform

  1. let's added "sandbox" solution configuration. if that's case new file named web.sandbox.config appear in solution explorer. go ahead , update values in web.config , web.sandbox.config so.

web.config:

<appsettings>   <add key="siteurl" value="http://localhost:4652/" /> </appsettings> 

web.sandbox.config:

<appsettings>   <add key="siteurl" value="http://sandbox.mysite.com/"       xdt:transform="setattributes"       xdt:locator="match(key)" /> </appsettings> 
  1. finally, need make "sandbox.mysite.com" (or whatever url is) publish profile , make sure configuration sandbox web.sandbox.config transform used during publish.

selecting sandbox configuration in publish web dialog


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

python 3.x - PyQt5 - Signal : pyqtSignal no method connect -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)