Search code examples
c#msbuildteamcitymultilineline-endings

TeamCity + Line endings, C# Multi-line verbatim strings


I have multi-line strings in the following format:

@"Text on Line 1
Text on Line 2."

When I build my tests in Visual Studio and run using VS Developer cmd, it runs fine and compares expected string vs actual.

But when running on teamcity using either MSBuild or VS sln, it only likes my multi-line strings, when they are in the following format with "\r\n" and no @ sign. And treats above format as having no new line character.

"Text on Line 1\r\nText on Line 2."

I decompliled the dll file with tests, that teamcity is producing and instead of "\r\n" all new line characters in verbatim multi-line string are replaced with "\n", so could be a teamcity issue with new line endings.

I could go ahead and change all my strings format, but looking for a solution to avoid it. thanks!


Solution

  • I had to check the "Convert line-endings to CRLF" checkbox in VCS root settings on teamcity