Click here to Skip to main content
15,891,136 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: How to create a set up Pin
Abhijit Jana19-Jul-09 0:15
professionalAbhijit Jana19-Jul-09 0:15 
QuestionListbox help please Pin
deadcell_617-Jul-09 21:37
deadcell_617-Jul-09 21:37 
AnswerRe: Listbox help please Pin
Pete O'Hanlon17-Jul-09 22:45
mvePete O'Hanlon17-Jul-09 22:45 
QuestionHow to Set Order of Properties in Property Grid VB.NET 2 Pin
luongmai17-Jul-09 5:54
luongmai17-Jul-09 5:54 
AnswerRe: How to Set Order of Properties in Property Grid VB.NET 2 Pin
Luc Pattyn17-Jul-09 10:39
sitebuilderLuc Pattyn17-Jul-09 10:39 
QuestionReports Layout Formating ....... Pin
shaina223116-Jul-09 20:10
shaina223116-Jul-09 20:10 
AnswerRe: Reports Layout Formating ....... Pin
shaina223117-Jul-09 18:46
shaina223117-Jul-09 18:46 
QuestionIs is even possible to write to the event log under Vista? Pin
Gregory Gadow16-Jul-09 6:12
Gregory Gadow16-Jul-09 6:12 
I have an application in production that has intermittent errors. I would like to add an error tracking feature so that, when an error gets channeled through the global handling routines, an entry gets written to the Event Log. I would like for this entry to use an event source unique to the application, to better track the errors.

So following Microsoft's own documentation, I tried this:

VB
If Not EventLog.SourceExists("MyApp") Then
    EventLog.CreateEventSource("MyApp", "Application")
End If
MyLog.Source = "MyApp"
MyLog.WriteEntry(DetailedMessage)
Unfortunately, EventLog.SourceExists throws an exception: the Framework attempts to check ALL of the logs, not just "Application", and Vista's psychotic paranoia does not allow the Framework to check the System log. So I tried always creating the source and ignoring the "source already exists" exception, like this:

VB
Try
    EventLog.CreateEventSource("MyApp", "Application")
Catch ex As Exception
    'Do nothing
End Try
MyLog.Source = "MyApp"
MyLog.WriteEntry(TextBox1.Text.Trim)
That throws the same exception about the System log, this time on EventLog.CreateEventSource. Attempting to write the entry therefore causes a "source does not exist" exception.

The solutions I have been able to find involve creating the event source manually, by writing the key to the registry. The key gets put in HKEY_LOCAL_MACHINE/System. Vista's "virtualization" has a firm lock on that node and redirects all programatic reads and writes to an isolated, user specific zone. This apparently rules out having the application create the source, as three different users will create three different logs, none of which will be visible to me when I log in as an administrator. And because this app runs on about 40 different machines, it is not feasable to go around to every one and configure the registry manually.

At this point, I see two options:

1. Roll my own event log. Write the errors out to an XML file and write a simple viewer to present the information.

2. Roll every workstation in the office back to XP because I am fed up with Vista.

Please, anyone, is it possible to use the event log under Vista? If so, HOW?
AnswerRe: Is is even possible to write to the event log under Vista? Pin
Mark Salsbery16-Jul-09 9:51
Mark Salsbery16-Jul-09 9:51 
GeneralScheduling emails: Pin
Priya060916-Jul-09 2:02
Priya060916-Jul-09 2:02 
GeneralRe: Scheduling emails: Pin
Luc Pattyn16-Jul-09 2:05
sitebuilderLuc Pattyn16-Jul-09 2:05 
GeneralRe: Scheduling emails: Pin
K030616-Jul-09 2:47
K030616-Jul-09 2:47 
GeneralRe: Scheduling emails: Pin
Manas Bhardwaj17-Jul-09 4:39
professionalManas Bhardwaj17-Jul-09 4:39 
QuestionTeam work Pin
Ebube16-Jul-09 0:46
Ebube16-Jul-09 0:46 
Answerrepost. ignore. Pin
Luc Pattyn16-Jul-09 1:31
sitebuilderLuc Pattyn16-Jul-09 1:31 
QuestionTeam work Pin
Ebube15-Jul-09 23:23
Ebube15-Jul-09 23:23 
AnswerRe: Team work Pin
K030616-Jul-09 0:18
K030616-Jul-09 0:18 
AnswerRe: Team work Pin
Pete O'Hanlon16-Jul-09 0:45
mvePete O'Hanlon16-Jul-09 0:45 
AnswerRe: Team work Pin
Pete O'Hanlon16-Jul-09 2:01
mvePete O'Hanlon16-Jul-09 2:01 
GeneralRe: Team work Pin
DoctorMick16-Jul-09 3:00
DoctorMick16-Jul-09 3:00 
GeneralRe: Team work Pin
Pete O'Hanlon16-Jul-09 3:24
mvePete O'Hanlon16-Jul-09 3:24 
GeneralRe: Team work Pin
Ebube16-Jul-09 11:00
Ebube16-Jul-09 11:00 
GeneralRe: Team work Pin
Pete O'Hanlon16-Jul-09 11:23
mvePete O'Hanlon16-Jul-09 11:23 
GeneralRe: Team work Pin
Patrick Fox28-Jul-09 10:30
Patrick Fox28-Jul-09 10:30 
QuestionNeed guidance and proposal of design and implementation for an e-voting (electronic voting) system Pin
bahareh65515-Jul-09 23:17
bahareh65515-Jul-09 23:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.