我注意到,当我调用NServiceBus.host.exe上的/ install标志时,在应用程序事件日志下创建事件日志源。麻烦的是,我们已经配置NServiceBus L4N将事件写入同一个源,但在自定义事件日志下。NServiceBus登录到自定义日志
这会导致一个问题,因为如果我们我们的自定义事件下创建源登录安装失败(NserviceBus安装程序将抛出System.ArgumentException:源等等已经存在的本地计算机上)。
那么我们应该如何阻止NServiceBus安装程序尝试在应用程序事件日志下创建事件源?
我们使用NServiceBus 3.0.1.0
感谢
编辑 - 全堆栈跟踪
Creating EventLog source blah in log Application...
An exception occurred during the Install phase.
System.ArgumentException: Source blah already exists
on the local computer.
The Rollback phase of the installation is beginning.
Restoring event log to previous state for source blah
.
Service blah is being removed from the system...
Service blah was successfully removed from the system
.
The Rollback phase completed successfully.
Unhandled Exception: System.InvalidOperationException: The installation failed, and the rollback has been performed. ---> System.ArgumentException: Source blah already exists on the local computer.
at System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData)
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 Topshelf.Internal.Hosts.HostServiceInstaller.Install(IDictionary stateSaver)
in d:\dev\open-source\topshelf\src\Topshelf\Internal\Hosts\HostServiceInstaller.cs:line 120
at System.Configuration.Install.Installer.Install(IDictionary stateSaver)
at System.Configuration.Install.TransactedInstaller.Install(IDictionary savedState)
--- End of inner exception stack trace ---
at System.Configuration.Install.TransactedInstaller.Install(IDictionary savedState)
at Topshelf.Internal.Hosts.HostServiceInstaller.Register() in d:\dev\open-source\topshelf\src\Topshelf\Internal\Hosts\HostServiceInstaller.cs:line 61
at Topshelf.Internal.Actions.InstallServiceAction.Do(IRunConfiguration configuration) in d:\dev\open-source\topshelf\src\Topshelf\Internal\Actions\InstallServiceAction.cs:line 42
at Topshelf.Runner.Host(IRunConfiguration configuration, String[] args) in d:\dev\open-source\topshelf\src\Topshelf\Runner.cs:line 70
at NServiceBus.Hosting.Windows.Program.Main(String[] args) in d:\BuildAgent-03\work\nsb.masterbuild1\src\hosting\NServiceBus.Hosting.Windows\Program.cs:line 122
NServiceBus只记录到控制台/文件,所以我非常确定这与实际的日志记录无关。我不是100%确定,但我认为安装Windows服务时会创建事件源? – 2012-04-10 13:28:14
这可能是顶部自动创建源代码。我需要深入挖掘 – 2012-04-10 13:31:56
我有完全相同的问题。你有没有发现是什么原因造成的? – 2012-12-18 11:52:24