BrightSoul
Jun 27th, 2005, 12:01 PM
hello there,
I'm relatively new to C#. I have to define a veeeeery long constant string and when I try to run an aspx page (Framework 1.1) containing this line of code:
private const string longString = "believe me this is very long [...]";
I get a compilation error CS1034
"Compiler limit exceeded: Line cannot exceed 2046 characters"
Now, the MSDN isn't helping, it's just displaying this (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cscomp/html/vcerrCompilerErrorSC1034.asp)
Do you know if there is any workaround to make it compile besides splitting the string into n pieces for subsequent concats into a variable? I'd really like to use a constant, this limitation is just silly if you ask me, expecially becuase if I had used VB.net I would have not encountered this problem.
Also, do you know if C# can use its own version of that useful Vb.net underscore feature that make long lines more readable?
Const longString As String = "abcdefg" & _
"hijklmnopq" & _
"rstuvwxyz012...."
Many thanks in advance :wave:
I'm relatively new to C#. I have to define a veeeeery long constant string and when I try to run an aspx page (Framework 1.1) containing this line of code:
private const string longString = "believe me this is very long [...]";
I get a compilation error CS1034
"Compiler limit exceeded: Line cannot exceed 2046 characters"
Now, the MSDN isn't helping, it's just displaying this (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cscomp/html/vcerrCompilerErrorSC1034.asp)
Do you know if there is any workaround to make it compile besides splitting the string into n pieces for subsequent concats into a variable? I'd really like to use a constant, this limitation is just silly if you ask me, expecially becuase if I had used VB.net I would have not encountered this problem.
Also, do you know if C# can use its own version of that useful Vb.net underscore feature that make long lines more readable?
Const longString As String = "abcdefg" & _
"hijklmnopq" & _
"rstuvwxyz012...."
Many thanks in advance :wave: