The E-mail Router service could not run
Saturday, February 9, 2008 at 09:31PM Not sure why but had the e-mail router decide it needed a vacation. The message isn't clear where the state XML file is located but neither the service or the configuration tool would start,
After doing the Repair, rebooting the server I was still stuck at no luck. I finally then decided to uninstall and re-install the email router. Even after that the error still occurred. It wasn't till I finally deleted the e-mail router folder in Program Files that I was able to re-install and have things run.
Of course the configuration was empty after the delete of the folder and re-install - the config on this server was simple so it wasn't really a big deal to re-configure. I did take a few minutes after I set it back up to find where the config is stored in case this happens again. First, the configuration file can be found by default at C:\Program Files\Microsoft CRM Email\Service\Microsoft.Crm.Tools.EmailAgent.xml
The state file referenced in the error below is also located in the service folder. Possibly if I looked at that folder before I might have been able to make it happy.
I have now backed up both of these files to save a copy so I hopefully wouldn't have to start from scratch if this happens again.
I think it would be great for the e-mail router to have an real support for Export Configuration and Import Configuration
#16192 - The E-mail Router service could not run the service main background thread. The E-mail Router service cannot continue and will now shut down. System.Configuration.ConfigurationErrorsException: The E-mail router service cannot access system state file Microsoft.Crm.Tools.EmailAgent.SystemState.xml. The file may be missing or may not be accessible. The E-mail Router service cannot continue and will now shut down. ---> System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at Microsoft.Crm.Tools.Email.Providers.ConfigFileReader..ctor(String filePath, ServiceLogger serviceLogger)
at Microsoft.Crm.Tools.Email.Providers.SystemState.Initialize(ServiceLogger serviceLogger)
at Microsoft.Crm.Tools.Email.Providers.SystemState..ctor(ServiceLogger serviceLogger)
at Microsoft.Crm.Tools.Email.Agent.ServiceCore.InitializeSystemConfiguration()
--- End of inner exception stack trace ---
at Microsoft.Crm.Tools.Email.Agent.ServiceCore.InitializeSystemConfiguration()
at Microsoft.Crm.Tools.Email.Agent.ServiceCore.ExecuteService()
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Reader Comments (4)
Oh how I love CRM and it's support...
then run rebuild. I did not uninstall. Prior to deleting, I opened file in notepad and it was blank. If you don't delete if first, repair won't replace it.