windows服务是否记录它们为何无法启动?

windows服务是否记录它们为何无法启动?,windows,dll,service,Windows,Dll,Service,我的windows服务不会在全新的windows server 2012安装上启动 当我尝试启动服务时,我得到了这个错误 本地计算机上的Foobar服务已启动,然后停止。如果某些服务未被其他服务或程序使用,则会自动停止 我来自linux背景,很少使用windows。在我的故障排除尝试中,我能够收集以下日志 The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly

我的windows服务不会在全新的windows server 2012安装上启动

当我尝试启动服务时,我得到了这个错误

本地计算机上的Foobar服务已启动,然后停止。如果某些服务未被其他服务或程序使用,则会自动停止

我来自linux背景,很少使用windows。在我的故障排除尝试中,我能够收集以下日志

The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly.\u000d\u000a   at System.Diagnostics.PerformanceCounter.InitializeImpl()\u000d\u000a   at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, String instanceName, Boolean readOnly)\u000d\u000a   at System.Diagnostics.PerformanceCounter..ctor(String categoryName, String counterName, Boolean readOnly)\u000d\u000a   at foobar.sage.OnStart(String[]
我在谷歌首页上尝试过的东西

修改HKLM/\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib
禁用性能计数器=0

loadctl /r

这些尝试都没有解决这个问题。是否有一个地方windows会显示其他日志,说明为什么此服务无法启动

除了查看事件查看器,您似乎没有更多的日志记录功能

我最终通过使用InstallUtil而不是sc.exe来运行它

sc.exe create foobar obj= "example.com\\someuser" password= "correct-horse-battery-staple" binPath= c:\foobar.exe start= auto depends= "MSMQ"

sc.exe delete foobar

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /user="example.com\someuser" /password="correct-horse-battery-staple" c:\foobar.exe

你开发了这个软件吗?或者它是由第三方开发的?它是很久以前在我的公司开发的。该应用程序正在所有现有服务器上运行,但不会在我正在创建的新服务器上运行。您还有源代码吗?如果你不知道,这不是一个真正的编程问题,更适合你。你是正确的梅森,搬到旧金山
loadctl /r
sc.exe create foobar obj= "example.com\\someuser" password= "correct-horse-battery-staple" binPath= c:\foobar.exe start= auto depends= "MSMQ"

sc.exe delete foobar

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe /user="example.com\someuser" /password="correct-horse-battery-staple" c:\foobar.exe