我一直在处理 IIS 服务的问题。它时不时地会停止工作,而且总是出现相同的问题:由于 WAS 服务未启动,IIS 服务和应用程序池无法启动。而 WAS 因以下奇怪错误而失败:Windows could not start the Windows Process Activation Service service on Local Computer. Error 13: The data is invalid.
互联网上有很多关于此内容的讨论,但对我来说都不起作用:
- 第二台机器使用同样的 Windows 10 Ent,IIS 运行正常
- 逐行比较
C:\Windows\System32\inetsrv\Config
目录中的配置文件仅产生完全匹配的有效 XML 文件 - 预期存在的文件夹
C:\inetpub\temp\apppools
都在那里 - 与 WAS 相关的注册表文件全部与第二台机器匹配
对我而言有效的解决方案是完全删除 IIS 和 WAS,然后重新启动并重新安装。我这样做了很多次。但是,两天后,问题又出现了,我无法通过重新安装来使其正常工作。
我一直在网上查阅资料并尝试不同的方法,但现在已经没有耐心来解决这个问题了。
以下是我尝试启动 IIS 时发生的一系列事件(按升序排列):
以下是上述操作之后立即出现的警告:
我还想补充一点,昨天这个问题出现之前,我看到了一系列错误:
现在,带有来源的那个:SMSvcHost 4.0.0.0
有点有趣,因为它有以下详细信息:
A request to start the service failed.
Error Code: System.Configuration.ConfigurationErrorsException: The type 'Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior, Microsoft.VisualStudio.Diagnostics.ServiceModelSink, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' registered for extension 'Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior' could not be loaded. (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config line 247)
at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.ServiceModel.Activation.AspNetEnvironment.UnsafeGetSectionFromConfigurationManager(String sectionPath)
at System.ServiceModel.Configuration.ConfigurationHelpers.UnsafeGetAssociatedSection(ContextInformation evalContext, String sectionPath)
at System.ServiceModel.Description.ConfigLoader.LookupCommonBehaviors(ContextInformation context)
at System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress, Boolean skipHost)
at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection)
at System.ServiceModel.ServiceHostBase.ApplyConfiguration()
at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses)
at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
at System.ServiceModel.Activation.SharingService.StartControlService()
at System.ServiceModel.Activation.SharingService.Start()
at System.ServiceModel.Activation.TcpPortSharing.OnStart(String[] args)
Process Name: SMSvcHost
Process ID: 3348
它指向 machine.config,但我不明白它为什么会抱怨。我以为它正在寻找与 SMB 服务相关的内容,而我没有在 Windows 组件中安装它。
我现在被这个问题困扰了。