I am trying to use TeamCity File Content Replacer build feature to replace certain keys in my App.config file (.NET console project). As mentioned in official documentation i have specified
Process File : File which i would like to make replacements in
Find what : RegEx which denotes the text i would like to replace
Replace With : TeamCity variable with which i like to replace text
Everything works fine if Replace With text is short enough , for example dummyText works however things go wrong with lengthier values like \\Server675X\Shared\Artifactory\
, the error message received in build logs is as follows :
[File Content Replacer] Applying replacement "\\Server675X\Shared\Artifactory\" to lines matched by pattern "(?<=key="MappingFileLocation" value=").*(?="\/>)" in the files matched by wildcard: **/SolutionName/App.config...
[File Content Replacer] Error replacing "(?<=key="MappingFileLocation" value=").*(?="\/>)" with "\\Server675X\Shared\Artifactory\": string index out of range: 32. Check your settings.
[File Content Replacer] Error replacing file contents: string index out of range: 32
I can see that 32 is exactly the length of replacement string, question is what setting do i need to check/modify to make this replacement possible ?
PS : I am using TeamCity Enterprise 9.1.7 (build 37573)