473,395 Members | 1,949 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.

ErrorLog.WriteEntry : force exception

Can anyone think of a way to force ErrorLog.WriteEntry() to throw an
exception (assuming you don't specify another machine) ?

If you specify a non-existent source , it will automatically create a log
for it , so that won't work.

Jul 13 '06 #1
1 1950
Can anyone think of a way to force ErrorLog.WriteEntry() to throw an
exception (assuming you don't specify another machine) ?
For what? unitTest?
If you specify a non-existent source , it will automatically create a log
for it , so that won't work.
Did you look at msdn? Exception is raised in case of
- The Source property of the EventLog has not been set.
- The source is already registered for a different event log.
- The message string is longer than 32766 bytes.
- The source name results in a registry key path longer than 254 characters.
- or -

The source name results in a registry key path longer than 254 characters.

--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Jul 13 '06 #2

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

Similar topics

3
by: Karl Roes | last post by:
Hi all, I am after some suggestions on ways to email an errorlog table. I have been working on remote interfaces and would like the users to email the errorlog back to me at the push of a button...
4
by: John Lee | last post by:
Hi, Why EventLog.WriteEntry() works fine with Windows ME (where is the message being written or just ignored?) and throw exception on Windows98 and 98SE. Should it be handled at Framework level?...
2
by: David Hunt | last post by:
I'm developing a Windows Service and just added a standard try... catch exception handler to its OnStart() routine. I would like to know how to force the service to abort its startup when an...
3
by: KarlM | last post by:
I would like to write to the EventLog (Application) with following code. But this works only under admin account. There are no restrictions in the WriteEntry-documentation. Can anyone help me? ...
1
by: yancheng.cheok | last post by:
Hi all, According to "How can I handle a constructor that fails?" in http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.2, whenever there is a constructor fail, we will throw...
3
by: Dachshund Digital | last post by:
Has any one figured out how to override the WriteEntry or show change the actual output? I am sorry, but putting the DATE/TIME PROCESS # and Thread # information AFTER the 'Message' text just...
0
by: jammendolia | last post by:
Hello all, I am having an intermittent exception occur when writing the the eventlog from a windows service application written in c#, running on a Win2k SP4 server. Here's the code: ...
4
by: Teresa Masino | last post by:
We have set up a couple of SQL Server 2005 systems and I have found that the format of the ERRORLOG files and the SQL Agent's log files are Unicode or some format that findstr cannot parse...
0
by: =?Utf-8?B?RGFya3Jpc2Vy?= | last post by:
I have managed code in C# calling unmanaged code from a DLL written in C++. Every time an Exception is thrown by unmanaged code, this exception is handled by C# directly. How to force to handle...
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
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
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.