I've implemented Scott Hanselman's method for keeping up with a dev/qa/prod version of web.config: http://www.hanselman.com/blog/CommentView.aspx?guid=93bfa4b3-44cd-4681-b70e-f4a2b0386466
For some reason when I compile my project I get this error message in my output window.
Any ideas?
------ Build started: Project: ABC.Flims.Web, Configuration: Development Any CPU ------ "C:\Projects\ballyhoo-trunk\src\ABC.Flims.Web\scripts/copyifnewer.bat" "C:\Projects\ballyhoo-trunk\src\ABC.Flims.Web\web.config.Development" "C:\Projects\ballyhoo-trunk\src\ABC.Flims.Web\web.config" '@echo' is not recognized as an internal or external command, operable program or batch file.
Here is the script file:
@echo off echo Comparing two files: %1 with %2 if not exist %1 goto File1NotFound if not exist %2 goto File2NotFound fc %1 %2 if %ERRORLEVEL%==0 GOTO NoCopy echo Files are not the same. Copying %1 over %2 copy %1 %2 /y & goto END :NoCopy echo Files are the same. Did nothing goto END :File1NotFound echo %1 not found. goto END :File2NotFound copy %1 %2 /y goto END :END echo Done.
To display the command prompt, type echo on. If used in a batch file, echo on and echo off don't affect the setting at the command prompt. To prevent echoing a particular command in a batch file, insert an @ sign in front of the command.
The ECHO-ON and ECHO-OFF commands are used to enable and disable the echoing, or displaying on the screen, of characters entered at the keyboard. If echoing is disabled, input will not appear on the terminal screen as it is typed. By default, echoing is enabled.
It is used to get the ECHO statement to output a blank line. In accordance with its design, the ECHO issued blank or with just white space after the command text, outputs the current 'echo' status, that is ON or OFF. To support the outputting of blank lines a dot is commonly appended to the command, as in ... echo.
The file is probably Unicode encoded and has a Byte Order Mark (BOM) at the start that is throwing off the batch processor.
Save it as an ASCII file and you should be OK. You can do this in notepad
- select Save As...
from the File
menu and ensure that the Encoding
dropdown is set to ANSI
.
Stumbled upon a similar issue. Found that within visual studio, if you open your *.bat file, you can choose File -> Advanced Save Options. From the drop-down menu under encoding, select 'US-ASCII - Codepage 20127'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With