Quoting front slash "/"

Feb 24, 2011 at 1:23 PM

I trying to search and replace URL like this:

XmlSearchReplace.exe /O=av /S="http://localhost:5000/MyApp" /R="http://192.168.19.144:5000/MyApp" /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:"/""/"192.168.19.144:5000"/"MyApp" /F="D:\web.config"

I will get the same error.

How to correct this?

Coordinator
Feb 24, 2011 at 11: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 10:26 PM

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

Coordinator
Sep 11, 2014 at 9:29 AM
Edited Sep 11, 2014 at 9: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="http://192.168.19.144:5000/MyApp" /F="D:\web.config"
the string
/S="http://localhost:5000/MyApp" is passed on as /S=http://localhost:5000/MyApp while /R="http://192.168.19.144:5000/MyApp" as /R=http://192.168.19.144:5000/MyApp 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=\"http://192.168.19.144:5000/MyApp\" 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