Writing to a File in a New Thread 
Author Message
 Writing to a File in a New Thread

I have an ASP.NET app that invokes a VB.NET process in a
new thread.  The ASP.NET refreshes a page that displays
the process status.

In an effort to debug the process running in the new
thread (previous post), I've tried to write to a text
file.  The information gets written to the text file but
then the thread appears to stop executing.  It seems that
writing to a text file somehow corrupts the thread and
causes it to abort.

I have used the save method of XmlDocument and a
StreamWriter with File.AppendText; both have the same
effect on the thread.

Any help would be greatly appreciated...

Thank you



Mon, 15 Aug 2005 12:41:42 GMT  
 Writing to a File in a New Thread
Hello David,

EventLog is a good place to record the trace information while an
application is running. You may get more information about it from the
links below:

Event Logs and Multithreaded Components
http://msdn.microsoft.com/library/en-us/vbcon/html/vbconeventlogsmult...
edcomponents.asp

How Do I...Write to an event log?
http://samples.gotdotnet.com/quickstart/howto/doc/LogWrite.aspx

I hope this helps you.

Best regards,

Lion Shi [MSFT]
MCSE, MCSD
Microsoft Support Engineer

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.  2003 Microsoft Corporation. All rights
reserved.
--------------------
    Content-Class: urn:content-classes:message


    Subject: Writing to a File in a New Thread
    Date: Wed, 26 Feb 2003 20:41:42 -0800
    Lines: 19

    MIME-Version: 1.0
    Content-Type: text/plain;
        charset="iso-8859-1"
    Content-Transfer-Encoding: 7bit
    X-Newsreader: Microsoft CDO for Windows 2000
    X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    Thread-Index: AcLeGoZEEkaRXM+KQraS87r6YSPVbA==
    Newsgroups: microsoft.public.dotnet.languages.vb
    NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
    Path: cpmsftngxa06!cpmsftngxa08.phx.gbl
    Xref: cpmsftngxa06 microsoft.public.dotnet.languages.vb:92880
    X-Tomcat-NG: microsoft.public.dotnet.languages.vb

    I have an ASP.NET app that invokes a VB.NET process in a
    new thread.  The ASP.NET refreshes a page that displays
    the process status.

    In an effort to debug the process running in the new
    thread (previous post), I've tried to write to a text
    file.  The information gets written to the text file but
    then the thread appears to stop executing.  It seems that
    writing to a text file somehow corrupts the thread and
    causes it to abort.

    I have used the save method of XmlDocument and a
    StreamWriter with File.AppendText; both have the same
    effect on the thread.

    Any help would be greatly appreciated...

    Thank you



Mon, 15 Aug 2005 19:33:17 GMT  
 Writing to a File in a New Thread
Thanks Lion!  I'll check it out.

Quote:
>-----Original Message-----
>Hello David,

>EventLog is a good place to record the trace information
while an
>application is running. You may get more information
about it from the
>links below:

>Event Logs and Multithreaded Components
>http://msdn.microsoft.com/library/en-

us/vbcon/html/vbconeventlogsmultithread
Quote:
>edcomponents.asp

>How Do I...Write to an event log?
>http://samples.gotdotnet.com/quickstart/howto/doc/LogWrit
e.aspx

>I hope this helps you.

>Best regards,

>Lion Shi [MSFT]
>MCSE, MCSD
>Microsoft Support Engineer

>This posting is provided "AS IS" with no warranties, and
confers no rights.
>You assume all risk for your use.  2003 Microsoft

Corporation. All rights

- Show quoted text -

Quote:
>reserved.
>--------------------
>    Content-Class: urn:content-classes:message


>    Subject: Writing to a File in a New Thread
>    Date: Wed, 26 Feb 2003 20:41:42 -0800
>    Lines: 19

>    MIME-Version: 1.0
>    Content-Type: text/plain;
>            charset="iso-8859-1"
>    Content-Transfer-Encoding: 7bit
>    X-Newsreader: Microsoft CDO for Windows 2000
>    X-MimeOLE: Produced By Microsoft MimeOLE
V5.50.4910.0300
>    Thread-Index: AcLeGoZEEkaRXM+KQraS87r6YSPVbA==
>    Newsgroups: microsoft.public.dotnet.languages.vb
>    NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
>    Path: cpmsftngxa06!cpmsftngxa08.phx.gbl
>    Xref: cpmsftngxa06

microsoft.public.dotnet.languages.vb:92880

- Show quoted text -

Quote:
>    X-Tomcat-NG: microsoft.public.dotnet.languages.vb

>    I have an ASP.NET app that invokes a VB.NET process
in a
>    new thread.  The ASP.NET refreshes a page that
displays
>    the process status.

>    In an effort to debug the process running in the new
>    thread (previous post), I've tried to write to a
text
>    file.  The information gets written to the text file
but
>    then the thread appears to stop executing.  It seems
that
>    writing to a text file somehow corrupts the thread
and
>    causes it to abort.

>    I have used the save method of XmlDocument and a
>    StreamWriter with File.AppendText; both have the
same
>    effect on the thread.

>    Any help would be greatly appreciated...

>    Thank you

>.



Mon, 22 Aug 2005 00:04:31 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Write to a log file using a new thread

2. Opening a form in a new thread, appart from the Apps main thread

3. Need help editing an Input file (text) and writing the to a new, altered Output file

4. Creating and Writing a new file

5. Creating new txt file for writing

6. Writing a threaded Service...

7. How to write Threads in VB5.0

8. New thread for a stream

9. New thread for function which takes parameters

10. Passing data to a new thread

11. Starting a new Thread in VB5.0

12. NEW THREAD: Promoting Your VB APP ??

 

 
Powered by phpBB® Forum Software