Quoting front slash "/"

Feb 24, 2011 at 12:23 PM

I trying to search and replace URL like this:

XmlSearchReplace.exe /O=av /S="http://localhost:5000/MyApp" /R="" /F="D:\web.config"

This will return error: Application only supports the following parameters: /S, /R, /O, /F, /C, /I, /W, /D, /L, /P

If i write like this:

XmlSearchReplace.exe /O=av /S="http:"/""/"localhost:5000"/"MyApp" /R="http:"/""/""/"MyApp" /F="D:\web.config"

I will get the same error.

How to correct this?

Feb 24, 2011 at 10:49 PM

Hi priomino,

The first syntax should have been correct. I'm looking into why this is not parsing...

Thanks for using xmlsearchandreplace.

Jul 6, 2011 at 9:26 PM

Did this ever get resolved? I'm having the same problem.

Sep 11, 2014 at 8:29 AM
Edited Sep 11, 2014 at 8:40 AM
As it turns out, it's more of an issue with how .net supplies the command line arguments to the application :(. In case of
XmlSearchReplace.exe /O=av /S="http://localhost:5000/MyApp" /R="" /F="D:\web.config"
the string
/S="http://localhost:5000/MyApp" is passed on as /S=http://localhost:5000/MyApp while /R="" as /R= causing the program to mis understand the argument.
The temporary work around is to put a backslash in front of the double quotes, so that the double quotes are passed down.
Therefore, passing on /S=\"http://localhost:5000/MyApp\" and /R=\"\" works just fine.

A more intuitive fix has to be more thought through, but for now this work around should do.
Marked as answer by xertrex on 9/11/2014 at 1:30 AM