I am using TeamCity by Jetbrains for some Continuous Integration. I am trying to change the Assembly file version number in a visual studio 2019 project using TeamCity's File Content Replacer. I selected .Net Core Assembly file version from the templates, which gave me
(<(FileVersion)\s*>).*(<\/\s*\2\s*>). I put
**/*.csproj in the "Process Files" and
<FileVersion>%build.number%</FileVersion> in "Replace with".
This is the error I get in the TeamCity build log:
Applying replacement "184.108.40.206" to lines matched by pattern "(<(FileVersion)\s*>).(</\s\2\s*>)" in the files matched by wildcard: **/*.csproj... Total files changed: 0. No modifications were made: either no text matching the pattern was found or the replaced text is the same as the original
**/*.csproj detects a wildcard, because changing it has netted in pure failure. I tested the regex in https://regex101.com/ and it detected what I needed in the file. This is the layout in the project file:
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.12.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
<PackageReference Include="MSBuild.Extension.Pack" Version="1.9.1" />
When I put this into the tester, the regex can detect the FileVersion line. Is there an issue with my regex? Or is my file path wrong?