Question about *****Assert***** on LCD

OK… I’m stumped! or maybe stupid?

I have not been able to solve this issue in my code.

I have several methods that use the SD Card. All is well until I try to write to file.

[Code]
private StreamWriter sw;
sw = new StreamWriter(s, true); //string s is the path

foreach (string Econtent in sarray) //sarray[] is a array of 70 data strings received from my WiFly device (Roving not the GHI device)
{
sw.WriteLine(Econtent); // The Assert occurs upon the first use of sw.WriteLine();
}



The LCD goes to a black background with the Assert text message shown and remains that way until the foreach loop is finished.
Upon exit of the loop (a few seconds after) the LCD returns to normal with no loss of any information. The text file saved to the SD Card is written correctly.

If I put a breakpoint at the line ( sw.WriteLine(Econtent); ) and use F5 to continue throught the 70 strings, I do not receive the Assert message and the LCD
remains normal?

I tried using the foreach loop in a different thread but this makes no difference. I still receive the Assert message.

No code is used to access the T35 LCD display while reading/writing the SD Card.

And ideas?


Thanks in advance.....

What device?

This should never happen and if it did we need full details about your setup with a small test app.

@ willgeorge - FYI if you use

 instead of [End Code] then the forum will format your code beautifully for you and it will be much easier to read.

Gus, ianlee74 and others

Update on my question:

I have discovered that the Assert message I was getting only occurs in Debug mode. I do not receive the Assert when starting my app. without debugging.

I was testing my code in 2010 Express (using debugging) when I experienced the Assert. For some reason I never tried running the application without debugging.

Under debugging I only seem to get the Assert when using the StreamWriter write. I can create directories and files on the SD Card without any problems. I’m going to see what happens using StreamReader read when I have time.

What kind of Assert message is it. Does it have any additional information?

Architect

No additional information is given. Just a black display containing the text Assert