Problem with instantiation XmlSerializer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • peochei
    New Member
    • Oct 2010
    • 12

    #1

    Problem with instantiation XmlSerializer

    I've a problem while creating new instance of XmlSerializer. I thought it could occur because of improper solution platform. But I checked all possibilities.

    Machine config:
    • Windows XP SP3
    • .NET 3.5 SP1


    Any suggestions how to track the problem?

    Here's what I got:
    Code:
    System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section system.serviceModel. (E:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 134)
       at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
       at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
       at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
       at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
       --- End of inner exception stack trace ---
       at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
       at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName)
       at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
       at System.Configuration.ConfigurationManager.GetSection(String sectionName)
       at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
       at System.Diagnostics.DiagnosticsConfiguration.GetConfigSection()
       at System.Diagnostics.DiagnosticsConfiguration.Initialize()
       at System.Diagnostics.DiagnosticsConfiguration.get_SwitchSettings()
       at System.Diagnostics.Switch.InitializeConfigSettings()
       at System.Diagnostics.Switch.InitializeWithStatus()
       at System.Diagnostics.Switch.get_SwitchSetting()
       at System.Diagnostics.BooleanSwitch.get_Enabled()
       at System.Xml.Serialization.TempAssembly.LoadGeneratedAssembly(Type type, String defaultNamespace, XmlSerializerImplementation& contract)
       at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
       at System.Xml.Serialization.XmlSerializer..ctor(Type type)
    (...)
  • peochei
    New Member
    • Oct 2010
    • 12

    #2
    Strange enough.
    I solved it by copying 'WINDOWS\Micros oft.NET\Framewo rk\v2.0.50727\C onfig\machine.c onfig' from different computer.

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      It sounds like the install for .NET2.0 got corrupted. Copying a file over from another PC isn't exactly "safe", but 9/10 is probably fine

      Comment

      Working...