I have a .NET 2.0 application that is not unusual. It worked until yesterday on every PC on which I installed or copied it, regardless of whether 2.0, 3.0, 3.5 or 3.5 SP1 was installed, regardless of whether it was Win2000, XP or even Win7 (100 machines in total )
Yesterday I did my usual installation procedure and wanted to run it once to check if everything works ... and it doesnβt. The program worked hard, leaving me uninformative "Do you want to report this error?" Dialogue. The problem is an exception in the Main(String[] args) routine Main(String[] args) my application.
The event viewer displays the following entry:
Event Type: ErrorEvent Source: .NET Runtime 2.0 Error Reporting Event Category: None Event ID: 5000 Date: 05/05/2010 Time: 16:09:09 User: N/A Computer: myClientPC Description: EventType clr20r3, P1 apomenu.exe, P2 1.4.90.53, P3 4bdedea4, P4 system.configuration, P5 2.0.0.0, P6 4889de74, P7 1a6, P8 136, P9 ioibmurhynrxkw0zxkyrvfn0boyyufow, P10 NIL.
Well ... great information. After a great search, I was finally able to get additional information about this exception (by adding a handler for UnhandledExceptions directly to My.MyApplication.New(), Application.Designer.vb ):
System.Configuration.ConfigurationErrorsException Configuration system failed to initialize 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.Net.Configuration.SettingsSectionInternal.get_Section() at System.Net.Sockets.Socket.InitializeSockets() at System.Net.Sockets.Socket.get_SupportsIPv4() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.get_HostName() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.RegisterChannel(Boolean SecureChannel) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at MyAppNameHere.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Line 81.
And at that moment I was stuck ... I have no ideas. I do not use any configuration system from the framework (there is no reference to System.Configuration, and MyAppnameHere.exe.config has never been created or distributed, and I have not seen this error before). I also found a bug report in Microsoft (Google Cache) about this bug (in a different context, though). But, as it seems, they will not even look at him.
Any help is greatly appreciated!
Edit: I am using Visual Studio 2008 Prof .. Failure occurs in Release and Debug-Build on the client machine. Debugging the application directly on this computer is out of the question. I'm afraid 300+ miles and they only have two computers to work.
Edit2: Other .NET applications work fine.
Edit3: After Andrew pointed this out, I also looked at the Internal exception (I always forget that it exists):
System.Configuration.ConfigurationErrorsException Unknown configraution directive "system.serviceModel". (c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config line 145) 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)
I deleted this section, and now everything works as expected ... but now I have one question: why did other applications work?