简体   繁体   中英

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!

我必须在teamcity的VCS根目录设置中选中“将行尾转换为CRLF”复选框

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM