views:

2315

answers:

2

Some background: I have a windows service with 5 web references, Everything works great in several environments Dev,Test,QC. Dev and Test are running windows 2003, QC and PROD windows 2000. We pushed the service to production with the same set of assemblies and config files and are receiving this error. The exception is not consistent through the same block of code. Other web reference are working that use the same standard configuration elements.

The exception:

 System.Xml.XmlDocumentSystem.Configuration.
ConfigurationErrorsException: Unrecognized  
element 'setting'

Example config sections:

<sectionGroup name="applicationSettings"
 type="System.Configuration.ApplicationSettingsGroup, 
 System, Version=2.0.0.0,
 Culture=neutral, PublicKeyToken=b77a5c561934e089" >
      <section name="Blah.AWD.SubSystem.AUE.Properties.Settings"
      type="System.Configuration.ClientSettingsSection, 
      System, Version=2.0.0.0,
       Culture=neutral, PublicKeyToken=b77a5c561934e089" 
      requirePermission="false" />
</sectionGroup>


<applicationSettings>
 <Blah.AWD.SubSystem.AUE.Properties.Settings>
  <setting name=
   "AWD_SubSystem_AUE_WebService_Validator_AppEntryValidator"
    serializeAs="String">
        <value>http://blah.asmx&lt;/value&gt;
  </setting> 
 </Blah.AWD.SubSystem.AUE.Properties.Settings>   
</applicationSettings>
A: 

Are you 100% sure that the production environment is on the same version of .NET as your others? If the exact same code (you're sure all assemblies were dropped correctly?) runs correctly in 5 environments, and pukes in production, it sounds like it may be an environmental issue.

Is it possible that -- gah -- your prod environment only has .NET 1.1 available? Or that the web service in question was dropped into a 1.1 AppPool on IIS? (Although it sounds like the issue isn't the web service, but the Windows service -- which should moot out the last question ... )

John Rudy
John, thanks for the answer, ya it seems likely to be environment related and it is definitely the windows service causing the problem. The web services are up and running fine. This release is a conversion from 1.1 to 2.0We did an uninstall of the same service which was running under 1.1 and re-installed under 2.0. I have very limited access to production.
A: 

I will accept John's answer as being correct because it ended up being a deployment issue and was specific to the environment. Nothing was actually wrong with the config.

The exception:

 System.Xml.XmlDocumentSystem.Configuration.
ConfigurationErrorsException

is caused if you put an element in your config that is not recognized and not able to be serialized from the custom configuration class.