Je suis en train de déployer un service que j'ai écrit. Voici la InstallLog fichier:
Installing assembly 'c:\Users\brwatson\Development\Projects\TweetLinks\TweetLinkQueue\bin\Debug\TweetLinkQueue.exe'.
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
Installing service TweetLinkService...
Creating EventLog source TweetLinkService in log Application...
Rolling back assembly 'c:\Users\brwatson\Development\Projects\TweetLinks\TweetLinkQueue\bin\Debug\TweetLinkQueue.exe'.
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
Restoring event log to previous state for source TweetLinkService.
An exception occurred during the Rollback phase of the System.Diagnostics.EventLogInstaller installer.
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
An exception occurred during the Rollback phase of the installation. This exception will be ignored and the rollback will continue. However, the machine might not fully revert to its initial state after the rollback is complete.
Comme vous pouvez le voir, il ne fonctionne pas. Je ne suis pas sûr de savoir comment procéder, et ont frappé le mur avec Bing et Google. J'ai mis le Compte système local pour le serviceProcessInstaller1. Le code se compile bien, mais maintenant, je tiens à exécuter la chose...des idées? Je suis administrateur sur ma boîte, et je suis en cours d'exécution de la commande:
InstallUtil TweetLinkQueue.exe
à partir de la VS2008 console d'administration.
Mis à JOUR AVEC /ShowCallStack option
La Pile Des Appels
An exception occurred during the Install phase.
System.Security.SecurityException: The source was not found, but some or all eve
nt logs could not be searched. Inaccessible logs: Security.
at System.Diagnostics.EventLog.FindSourceRegistration(String source, String m
achineName, Boolean readOnly)
at System.Diagnostics.EventLog.SourceExists(String source, String machineName
)
at System.Diagnostics.EventLogInstaller.Install(IDictionary stateSaver)
at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
at System.ServiceProcess.ServiceInstaller.Install(IDictionary stateSaver)
at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
at System.Configuration.Install.AssemblyInstaller.Install(IDictionary savedSt
ate)
at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
at System.Configuration.Install.TransactedInstaller.Install(IDictionary saved
State)
et voici que le constructeur:
public TweetLinkService()
{
InitializeComponent();
if (!EventLog.SourceExists("TweetLinkQueue"))
{
EventLog.CreateEventSource("TweetLinkQueue", "Log");
TweetLinksLog.Source = "TweetLinkQueue";
TweetLinksLog.Log = "Log";
TweetLinksLog.WriteEntry("Log Created!");
}
}
Mis à JOUR avec Point d'Entrée:
namespace TweetLinkQueue
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
static void Main()
{
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new TweetLinkService()
};
ServiceBase.Run(ServicesToRun);
}
}
}