473,406 Members | 2,707 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,406 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 1244

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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.