c# - Installing a self-developed Windows Service -
I'm trying to deploy a service that I wrote. Here is an installation file:
Installing Assembly 'c: \ users \ brwatson \ development \ projects \ TweetLinks \ TweetLinkQueue \ bin \ debug \ TweetLinkQueue.exe' The affected parameters are: logtoconsole = assemblypath = C: \ users \ brwatson \ development \ projects \ TweetLinks \ TweetLinkQueue \ bin \ debug \ TweetLinkQueue.exe logfile = c: \ users \ brwatson \ development \ projects \ TweetLinks \ TweetLinkQueue \ bin \ debug \ TweetLinkQueue.InstallLog service TweetLinkService ... logging service in log application Tweet source TweetLinkService ... rolling assembly 'c: \ Users \ brwatson \ Development \ Projects \ TweetLinks \ TweetLinkQueue \ bin \ Debug \ TweetLinkQueue.exe' Affected The parameters are: logtoconsole = assemblypath = c: \ users \ brwatson \ development \ projects \ TweetLinks \ TweetLinkQueue \ bin \ debug \ TweetLinkQueue.exe logfile = c: \ users \ brwatson \ development \ projects \ TweetLinks \ TweetLinkQueue \ bin \ debug \ Restoring event logs in the previous status for TweetLinkQueue.InstallLog source logs An exception occurred during the rollback phase of the TweetLinkService system. Diagnostics. EventLog Installer System.Security.SecurityException: Source not found, but some or all event logs could not be searched. Inaccessible logs: An exception occurred during the rollback phase of the security establishment. This exception will be ignored and rollback will continue. However, after the rollback is completed, the machine can not completely return to its initial state.
As you can see, it is not working. I'm not sure how to proceed, and beating Wall with Bing and Google, I've set up LocalSystem in the account for Service Process Installer 1. Code compile right, but now I would like to run this thing ... any thoughts? I'm an administrator on my box, and I'm running a command:
InstallLtil TweetLinkQueue.exe
From the VS2008 Admin console. An update occurred with the update / ShowCallStack option
call stack
installed with . System.Security.SecurityException: Source not found, but some or all of the Northeast Logs could not be found. Inaccessible logs: Security system.Diagnostics.EventLog.FindSourceRegistration (System string, string m achineName, Boolean read only) on System.Diagnostics.EventLog.SourceExists (string source, string machine name) System.Digagnostics.EventLogInstaller.Install (IDictionary StateSaver) on system System.ServiceProcess.ServiceInstaller.Install (IDictionary stateSaver) on the Configuration System install.Installer.Install (IDictionary stateSaver) on System.Configuration.Install.Installer.Install (IDictionary stateSaver) System.Configuration.Install.Installer.Install (IDictionary stateSaver ) On System.configuration.Install.AssemblyInstaller.Install (IDictionary Served ST ate) on System.Configuration.Install.Installer.Install (IDictionary stateSaver) system. Configuration. Installed. Trusted Installer.Install (IDictionary saved state)
And here's the creator:
public TweetLinkService () {InitializeComponent (); If (EventLog.SourceExists ("TweetLinkQueue")) {EventLog.CreateEventSource ("TweetLinkQueue", "Log"); TweetLinksLog.Source = "TweetLinkQueue"; TweetLinks Log Log = "log"; TweetLinksLog.WriteEntry ("Log created!"); }}
Updated with entry point:
namespace link linkyquo {static class program {/// & lt; Summary & gt; Main entry point for the application /// & lt; / Summary & gt; Static Zero Main () {ServiceBase] ServicesToron; ServicesToRun = New ServiceBase [New] TweetLinkService ()}; ServiceBase.Run (ServicesToRun); }}}}
I'm not sure what your typical problem looks like As the problem arises when creating an EventLog source I double-check that you have done that part correctly, you can refer step-by-step. Edit: Especially look at step 9. The problem may be because you are messing with an application log instead of a special for your application.
There is nothing wrong with using InstallUtil, but if you need to install your service on a foreign machine, then InstallUtil is not guaranteed to be there. You can uninstall yourself without the need to install / install your Windows Service executable by following this step-by-step. Look for those instructions.
Comments
Post a Comment