c# - overriding App.Config in prebuild and Use Settings -


i have settings files attached app.config , i'm using pre-build command line call bat file supposes override app.config based on selected configuration project (debug, release ...) before build process. looks good, app.config updated on build time (i can see changes in settings , app.config). when i'm trying value in settings using command this:

var test = settings.default.dbconn; 

but... first time (that app.config not override) works fine, when i'm changing configuration (let's debug release) error throwing says wrong xml or that, error configurationerrorsexception, , message

the value of property 'serializeas' cannot parsed. error is: enumeration value must 1 of following: string, xml, binary, providerspecific.

here bat file:

@echo off   if %1==debug  goto de if %1==dev goto dev if %1==release goto pr    :de xcopy  %2configs\app_debug.config  %2app.config  /y goto end  :pr xcopy  %2configs\app_prod.config  %2app.config  /y goto end  :dev xcopy  %2configs\app_dev.config  %2app.config /y goto end  :end 

i don't know problem checked out these discussions

hanselman

overriding app.config settings

manage multiple app config files during development

and few more. couldn't find solution. please me on this! thanks.

there visual studio extension called slowcheetah designed purpose. allows provided xslt transforms app.config each of build configurations. check out http://visualstudiogallery.msdn.microsoft.com/69023d00-a4f9-4a34-a6cd-7e854ba318b5


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 -