[Mono-aspnet-list] Problems writing a single new line. ASP.NET Ubuntu 11.04

cristian c191288 at hotmail.com
Tue Oct 4 02:02:59 EDT 2011

Hi all.

I have created a ASP.NET site on a Windows machine, tested in a windows
environment. Here my site works like a (as expected) charm. I have then
edited a few lines of code to make it portable to a Linux 11.04 server
running apache2 and mono. But here my site does not work as expected.

The problem is that, when i (through the site) writes to a text file, i use
the code as follows
Linux Server 11.04

if (tableListThree.Count == 0)
StreamWriter sw = newStreamWriter(getAndSet.PathOne, true);
sw.Write(_textBoxOne + "#" + _textBoxTwo + "#" + _textBoxThree + "#" +
_textBoxFour + "#" + _textBoxFive + "#" + _textBoxSix + "#" + _textBoxSeven
+ "#" + _textBoxEight);
StreamWriter sw = newStreamWriter(getAndSet.PathOne, true);
sw.Write("\n" + _textBoxOne + "#" + _textBoxTwo + "#" + _textBoxThree + "#"
+ _textBoxFour + "#" + _textBoxFive + "#" + _textBoxSix + "#" +
_textBoxSeven + "#" + _textBoxEight);

the "\n" makes a double newline instead of a single newline. Which leaves me
with a extra empty line.
I get the same result if i use a environment.newline or a writeline instead
of write.

On my Windows test system i use a environment.newline instead of the \n and
here it just works.
Both sites (Windows & Linux) are on the exact same number of code lines, so
their is no huge difference besides environment.newline vs \n and changed
paths to text files.

Is their anyone who can guide me to how i can locate the source of the
problem. If its mono or my code. I just wonder the code since it works on
the Windows environment. 

Thanks on advance.
Kind regards.

View this message in context: http://mono.1490590.n4.nabble.com/Problems-writing-a-single-new-line-ASP-NET-Ubuntu-11-04-tp3870006p3870006.html
Sent from the Mono - ASP.NET mailing list archive at Nabble.com.

More information about the Mono-aspnet-list mailing list