eventlog-source

What is the most reliable way to create a custom event log and event source during the installation of a .Net Service

三世轮回 提交于 2019-12-03 04:50:38
问题 I am having difficulty reliably creating / removing event sources during the installation of my .Net Windows Service. Here is the code from my ProjectInstaller class: // Create Process Installer ServiceProcessInstaller spi = new ServiceProcessInstaller(); spi.Account = ServiceAccount.LocalSystem; // Create Service ServiceInstaller si = new ServiceInstaller(); si.ServiceName = Facade.GetServiceName(); si.Description = "Processes ..."; si.DisplayName = "Auto Checkout"; si.StartType =

What is the most reliable way to create a custom event log and event source during the installation of a .Net Service

孤街浪徒 提交于 2019-12-02 18:06:24
I am having difficulty reliably creating / removing event sources during the installation of my .Net Windows Service. Here is the code from my ProjectInstaller class: // Create Process Installer ServiceProcessInstaller spi = new ServiceProcessInstaller(); spi.Account = ServiceAccount.LocalSystem; // Create Service ServiceInstaller si = new ServiceInstaller(); si.ServiceName = Facade.GetServiceName(); si.Description = "Processes ..."; si.DisplayName = "Auto Checkout"; si.StartType = ServiceStartMode.Automatic; // Remove Event Source if already there if (EventLog.SourceExists("AutoCheckout"))

Simplest way to write a log message and display in Perfview

断了今生、忘了曾经 提交于 2019-12-02 08:02:24
I need the to write a log message and capture that in PerfView . I would like to avoid using EventLog or EventSource because they are quite invasive: they require registering a new source or ETW provider, which leaves leftovers in the system. Ideally I just want to call Debug.WriteLine (which uses OutputDebugString ), but it seems that PerfView cannot collect it. Or is there some ETW provider that sees debug messages? If you have an answer, please state the two parts of the solution: What should I write in C#, and How to configure PerfView to capture it (if there is some ETW provider, just

Using EventLog in ClickOnce application

☆樱花仙子☆ 提交于 2019-12-01 05:48:52
I've got a library that I use across multiple ClickOnce applications. In the event of an error in this library I would like to write the error to the windows EventLog . I found a KB article on how but it seems that this requires administrator permissions to search the for the source. Specifically it chokes when trying to search the Security event log. Is there anyway to work around this and write to the event log in a ClickOnce application? I saw one person trying to write to a known source , but they didn't seem to be able to find a source that was consistently available. EDIT: Based on

Using EventLog in ClickOnce application

心不动则不痛 提交于 2019-12-01 02:22:18
问题 I've got a library that I use across multiple ClickOnce applications. In the event of an error in this library I would like to write the error to the windows EventLog . I found a KB article on how but it seems that this requires administrator permissions to search the for the source. Specifically it chokes when trying to search the Security event log. Is there anyway to work around this and write to the event log in a ClickOnce application? I saw one person trying to write to a known source,

In Windows, what default event sources are available in the Application Event Log?

可紊 提交于 2019-11-30 12:34:53
Short Version: Are the event sources "Application" and "Application Error" always included in the Application Event Log? Are they available on new installations of Windows XP, Vista and Windows 7? Would it be really bad to use them instead of creating my own source (an impossibility for me)? Long Version: I have a ClickOnce application that is used by users without administrative privileges on their machines. When I try to write to the Appliction Event Log, I get a security exception. (The Windows event logging infrastructure is trying to create me a new event source, and gets a security

In Windows, what default event sources are available in the Application Event Log?

会有一股神秘感。 提交于 2019-11-29 18:32:28
问题 Short Version: Are the event sources "Application" and "Application Error" always included in the Application Event Log? Are they available on new installations of Windows XP, Vista and Windows 7? Would it be really bad to use them instead of creating my own source (an impossibility for me)? Long Version: I have a ClickOnce application that is used by users without administrative privileges on their machines. When I try to write to the Appliction Event Log, I get a security exception. (The

How to create a .NET event log source using WiX

风格不统一 提交于 2019-11-28 09:54:24
This is an intentional semi-duplicate of How do you create an event log source using WiX and WIX: Create EventSource using .NET message file . My first question is, does it really have to be so complicated? Isn't there some way to simply specify to WiX, "my program is a .Net program, and it needs to write to the event log - please do the necessary setup"? OK, assuming that isn't possible, I'd like to receive any recommendations for the necessary WiX statements to make it work, irrespective of which version of .Net Framework is installed, and irrespective of whether it is a 32 or 64-bit system.

How do you create an event log source using WiX

半城伤御伤魂 提交于 2019-11-26 18:47:07
I'm creating an installer for a website that uses a custom event log source. I would like our WiX based installer to create that event log source during installation. Does anyone know the best way to do this using the WiX framework. Wix has out-of-the-box support for creating event log sources. Assuming you use Wix 3, you first need to add a reference to WixUtilExtension to either your Votive project or the command line. You can then add an EventSource element under a component : <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">