Replies: 3 comments
-
This is likely because the using statement preprocessor, to confirm if you do a string.Join(
"\r\n",
"using System;",
"namespace Test.Ns",
"{",
"}"
); It'll likely work. |
Beta Was this translation helpful? Give feedback.
-
Yes, in my code I did a similar thing - simple string concatenation with "+", and it worked. |
Beta Was this translation helpful? Give feedback.
-
Yes it's preprocessing being done, using directives are passed a long to the Roslyn compiler as just list of namespaces. they're commented out to not interfere with compilation and to preserve line numbers. |
Beta Was this translation helpful? Give feedback.
-
What You Are Seeing?
Cake adds double-slash comments ("\\") to string constants inside a script that have a specific format.
What is Expected?
Cake shouldn't alter constants in scripts :)
What version of Cake are you using?
Version 0.22.2+Branch.main.Sha.c8630875bc14ce11aa758e0dcd55f691da5f602b
Are you running on a 32 or 64 bit system?
64
What environment are you running on? Windows? Linux? Mac?
Windows
Are you running on a CI Server? If so, which one?
no
How Did You Get This To Happen? (Steps to Reproduce)
Simple script to reproduce the problem:
!!! It produces a strange response only when there's no white spaces before using or just normal spaces. It works correctly with tabs :) !!!
This outputs:
Beta Was this translation helpful? Give feedback.
All reactions