.NET application broken on one PC, out of control exception

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?

+6
exception
source share
7 answers

This error indicates that something is wrong with the .config file. It could be an application configuration file, or perhaps machine.config.

I suggest uninstalling / reinstalling .net on this machine.


Another thing to try is to check if the user can run your application as an elevated one (it starts as an administrator). The config system may try to access a file that the user does not have rights to. If they can run as admin, find out which files the configuration system is accessing, and then instruct the user to grant them access rights to these files.

+3
source share

On a Windows 2008 R2 machine, we had similar symptoms. We stated that installing .NET Framework 3.5.1 from features fixes our problem. This was the difference between the two machines in which one worked the other (missing 3.5.1), was not.

+6
source share

Judging by the call stack, it looks like the channel is incorrectly configured due to an unclear reason when you look at it differently, maybe there was something on the network without your knowledge, because you all did say that it worked, I just I can not help but think that the system configuration file (machine.config) has the wrong parameter, perhaps due to permissions?

The entire system configuration is located in the Windows folder, deep inside the .NET folder ... I assume that the runtime did not start correctly ... tried to restart the .NET runtime optimization service?

+1
source share

It looks like you are trying to configure a socket, there may be a firewall on the client PC that blocks the socket, or the code may not start due to some kind of security software. Have you tried running your code as an administrator and disabling all security software?

0
source share

You tried to delete the file "... \ Documents and Settings \ <user> \ Local Settings \ Application Data \ <application name> ... \ user.config" as described in http://support.microsoft.com/kb/ 956762 / en-gb ? The path may differ in future versions of Windows.

0
source share

I would suggest that the machine has a poor installation of the framework.

Try uninstalling and then reinstalling .Net.

0
source share

I was getting this error when I deployed my application on a production server, there were no errors on my local development machine. Therefore, I changed my mind about the reason: x64 is installed on my server, my application was compiled with the x86 platform by default, changed to "Any processor" and there are no more errors.

0
source share

All Articles