, , .
, appsettings.config.debug, appsettings.config.deploy, web.config.debug, web.config.deploy.
script, , , , . , FC.
pre-build:
"$(ProjectDir)copyifnewer.bat" "$(ProjectDir)web.config.$(ConfigurationName)" "$(ProjectDir)web.config"
"$(ProjectDir)copyifnewer.bat" "$(ProjectDir)appsettings.config.$(ConfigurationName)" "$(ProjectDir)appsettings.config"
copyifnewer.bat:
echo Config Maintenance
echo Today date of %date:~-4,4%\%date:~-10,2%\%date:~-7,2%
rem echo Comparing two files: %1 with %2
echo .
if not exist %1 goto File1NotFound
if not exist %2 goto File2NotFound
fc %1 %2
if %ERRORLEVEL%==0 GOTO NoCopy
echo These files are NOT the same. Copying %1 over %2
copy %1 %2 /y & goto END
:NoCopy
echo These files are the same. Nothing copied.
goto END
:File1NotFound
echo %1 not found.
goto END
:File2NotFound
copy %1 %2 /y
goto END
:END
echo Done.
echo .
. , -.
,