Fails to start .NET app, ConfigurationErrorsException

12,123

Solution 1

Looks like an installation issue. There is a bug raise on Connect.

http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=323659

This is offical Microsoft recommendation:

In the meantime, you should be able repair your install by running:

"%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe" /r /x

%windir%\Microsoft.NET\Framework\v3.5\WFServicesReg.exe /c

Solution 2

Here is a more relevant MS connect issue. I'm amazed MS haven't fixed this yet.

Uninstall 3.5, 3.0 and 2.0 (and any updates) then re-install 3.5. That should do it.

Share:
12,123
kaze
Author by

kaze

Updated on June 09, 2022

Comments

  • kaze
    kaze almost 2 years

    I've installed a clean XP virtual machine for test purposes, only .NET 3.5 SP1 redistributable is applied.

    When I try to start our WinForms app, it gives the following exception:

    System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section system.serviceModel. (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 134)

    The app works on other systems, I've never seen this before. What is extra interesting is that it's such clean machine with "only" XP and .NET 3.5 installed. We are not explicitly using WCF in the app either.

    I've seen on some forum that they have removed a section from machine.config, but it feels wrong to have to do that on a clean install, there should be a better solution. Any ideas?

  • Rob
    Rob over 14 years
    v3.5 is layered on top of v2, so this is the correct path for machine.config for a v3.5 app
  • kaze
    kaze over 14 years
    Hmm, did a repair on the .NET 3.5 installation, and the 3.0-folder appeared. However, when I run the ServiceModelReg.exe, it gives "Error: Configuration system failed to initialize".
  • zulucoda
    zulucoda over 11 years
    thanks this helped but for us we just re-installed by doing the following: %windir%\Microsoft.NET\Framework\v3.0\WFServicesReg.exe /i
  • amartynov
    amartynov about 11 years
    On Windows 8 systems: if running ServiceModelReg.exe shows messages about configuration errors, go to Control Panel > Programs and Features > Turn Windows features. There, first uninstall .NET Framework 3.5, next delete folders from v1.0 to v3.5 in Windows\Microsoft.NET\Framework, then reinstall .NET Framework 3.5. It solved the issue for me.