Process ID is 0 in the Event Viewer

S Abijith 446 Reputation points
2024-11-21T14:08:26.7533333+00:00

Hello All,

We have a WPF application built on .Net Framework 4.8. This application writes certain logs into the Event Viewer under the path 'Windows Logs/ Application'.

Currently, the logs are written into the 'Event Viewer', but the process id is displayed as 0.

We are using the code attached in the question for writing logs into the 'Event Viewer'EventViewer_Code.txt.

Can anyone please help us to get the actual process ID in the Event Viewer instead of 0?

Any help is appreciated!

Thank you in advance!!

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,053 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.