Search code examples
xmlwindows-7windows-services

The configuration section cannot contain a CDATA or text element in SMSvcHost.exe.config


I can't start the windows service "SMSvcHost" on my Windows 7 desktop. Here is the error message from the event log:

A request to start the service failed.
Error Code: System.Configuration.ConfigurationErrorsException: The configuration section cannot contain a CDATA or text element. (C:\Windows\Microsoft.NET\Framework64\v4.0.30319\SMSvcHost.exe.Config line 15)
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.GetSection(String configKey)
at System.ServiceModel.Activation.NetTcpSectionData..ctor()
at System.ServiceModel.Activation.ListenerConfig.EnsureInitializedForNetTcp()
at System.ServiceModel.Activation.TcpPortSharing.OnStart(String[] args)
Process Name: SMSvcHost
Process ID: 7016

The configuration file:

<?xml version="1.0" encoding="utf-8"?>
<!-- The configuration file for SMSvcHost.exe -->
<configuration>
   <runtime>
       <gcConcurrent enabled="false" />
   </runtime>
   <system.serviceModel>
      <!-- SMSvcHost ETW traces are redirected by default to an etwProviderId different from WCF's default. 
         To trace to the default provider, remove the etwProviderId attribute below. -->
       <diagnostics performanceCounters="Off" etwProviderId="{f18839f5-27ff-4e66-bd2d-639b768cf18b}"/>
   </system.serviceModel>
    <!-- Below are some sample config settings:     -->
      <system.serviceModel.activation>
       <net.tcp listenBacklog="10" maxPendingConnections="100" maxPendingAccepts="10" receiveTimeout="00:00:10" teredoEnabled="false">
         <allowAccounts>
             // LocalSystem account
             <add securityIdentifier="S-1-5-18"/>

             // LocalService account
             <add securityIdentifier="S-1-5-19"/>

             // Administrators account
             <add securityIdentifier="S-1-5-20"/>

             // Network Service account
            <add securityIdentifier="S-1-5-32-544" />

            // IIS_IUSRS account (Vista only)
             <add securityIdentifier="S-1-5-32-568"/>
         </allowAccounts>
      </net.tcp>
     <net.pipe maxPendingConnections="100" maxPendingAccepts="10" receiveTimeout="00:00:10">
         <allowAccounts>
             // LocalSystem account
             <add securityIdentifier="S-1-5-18"/>

             // LocalService account
             <add securityIdentifier="S-1-5-19"/>

             // Administrators account
             <add securityIdentifier="S-1-5-20"/>

            // Network Service account
            <add securityIdentifier="S-1-5-32-544" />

             // IIS_IUSRS account (Vista only)
             <add securityIdentifier="S-1-5-32-568"/>
         </allowAccounts>
     </net.pipe>
     <diagnostics performanceCountersEnabled="true" />
 </system.serviceModel.activation>

 </configuration>

What is wrong?


Solution

  • Okay, I just found the answer. Something like:

    <allowAccounts>
                <!-- LocalSystem account -->
                <add securityIdentifier="S-1-5-18"/>