473,395 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Help needed on Trace operation

============ RESEND ================

Dear all,

I have implementing some tracing function in my
applicatrion to store log information to file and event
logger.

I have actually a problem to logging to file, hwhere I get
an exception error saying :

"Cannot access to file becasue it is use by an other
process"

The error comes the second time I try to write to the file.

I have try to close the file and the trace stuff after
each write but nothing much still the error.

I have implemented as follow :

m_LogFile = New FileStream(m_File, FileMode.OpenOrCreate,
FileAccess.ReadWrite)
m_Listner = New TextWriterTraceListener
(m_LogFile)

'-- handle objet for sending to EvLog
m_EventLog = New EventLog("Debug Log")
m_EvtListner = New EventLogTraceListener
(m_EventLog)
m_EventLog.Source =
Source.GetType.Namespace.ToString

Trace.Listeners.Add(m_Listner)
Trace.Listeners.Add(m_EvtListner)
Trace.AutoFlush = True

The exception comes when the m_LogFile object start to
initialised.
IMPORTANT :
=============
The code above is located in a separate assembly that the
call which is instanciate the object for writing to log.

If I paste this code in the same assembly that the
instance is created it works fine all time
Any help will be aprreciate
Jul 19 '05 #1
0 1242

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Chris | last post by:
Hi, I have MSMQ installed on my domain controller (Win 2003) and on my XP client (developer box). I created a private queue under private queues. I am able to write messages to the queue like ...
12
by: LongBow | last post by:
Hello all, From doing a google serach in the newsgroups I found out that a string can't be returned from a function, but using a char* I should be able to do it. I have spent most of the day...
0
by: john | last post by:
Hi,All MS Tech Gurus: I need your help!!! It is the second time I post this message, I need get some feedback ASAP, Please Help!! Thanks a lot in advance. John I have a csharp method, using...
0
by: Henrik_the_boss | last post by:
Hello all. I have a couple of aspx pages. When something fails in them, I would like them to be able to log to either a database, a logfile, or the application log. All code is in C# I run...
5
by: Jason | last post by:
Hi all I get the following error when executing a rather intense stored procedure from an ASPX page. I have tried: - Increasing timeouts on IIS 5.0 (all areas that even mention timeout) - use...
8
by: Tim::.. | last post by:
Can someone please tell me why I keep getting the following error for some of my web application users but not others??? Even though the application runs from a central webserver??? Thanks for...
0
by: Serge calderara | last post by:
============ RESEND ================ Dear all, I have implementing some tracing function in my applicatrion to store log information to file and event logger. I have actually a problem to...
10
by: Mae Lim | last post by:
Dear all, I'm new to C# WebServices. I compile the WebService project it return no errors "Build: 1 succeeded, 0 failed, 0 skipped". Basically I have 2 WebMethod, when I try to invoke the...
1
by: CodeSeeker | last post by:
I have an application, which uses pop3 to read the messages from the mailbox, and it has been working fine for so many year. We recently have started changing this application to use java mail IMAP 4...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.