Fails to start .NET app, ConfigurationErrorsException
Asked Answered
S

6

7

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?

Sade answered 18/8, 2009 at 7:51 Comment(3)
Here's a link to another forum with the same problem, but could this soultion really be the right one. It's not a attractive solution to tell customers... community.sharpdevelop.net/forums/p/8662/24166.aspxSade
Probably better on serverfault mate. Sure seems like a nasty issue though, machine config on a greenfield XP + .net 3.5 SP1 should be perfeectCommonalty
I solved it by manually editing the machine.config, in this particular case, it does not matter, but this might be a much bigger issue if customer installations also experience this problem. Further investigations will follow then, if that will be the case.Sade
F
4

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

Florin answered 18/8, 2009 at 8:2 Comment(4)
Thanks for the advice. A very interesting thing on my installation though, is that the v3.0 folder is missing! (the 1.0, 1.1, 2.0 and 3.5 ar there)Sade
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".Sade
thanks this helped but for us we just re-installed by doing the following: %windir%\Microsoft.NET\Framework\v3.0\WFServicesReg.exe /iBradbradan
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.Eastlake
I
1

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.

Ipomoea answered 25/1, 2012 at 23:21 Comment(0)
D
0

Sounds like an MS config-issue: is the machine otherwise fully patched? Perhaps this got fixed after SP1.

It's certainly unfortunate that you'd need to edit machine.config (I mean, imagine asking a user to do that...)

Ducks answered 18/8, 2009 at 8:1 Comment(0)
B
0

I have same problem, I am using windows xp 64, my resolve is modify machine.config in:

  1. %windir%\Microsoft.NET\Framework\v2.0.50727\Config\machine.config

  2. %windir%\Microsoft.NET\Framework64\v2.0.50727\Config\machine.config

Content of the machine.config you may see the example here: http://weblogs.asp.net/bhouse/archive/2005/11/10/430270.aspx

Boatbill answered 18/5, 2013 at 7:35 Comment(0)
P
0

I started to get this problem after uninstalling Oracle Client Drivers and it removed my C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\machine.config!

Copying it from another computer resolved the problem.

Preterit answered 19/1, 2015 at 2:50 Comment(0)
F
-2

I think your application is built by using dotnet framework 2, so try to install 2 not 3.5 and check.

C:\WINDOWS\Microsoft.NET\Framework\ v2.0.50727\Config\machine.config line 134

Frankie answered 18/8, 2009 at 7:59 Comment(1)
v3.5 is layered on top of v2, so this is the correct path for machine.config for a v3.5 appHydromedusa

© 2022 - 2024 — McMap. All rights reserved.