给定的C#Wintoms应用程序突然停止工作,并在给定的计算机上启动



上下文

我使用的是几年前写的WinForms/C#.NET实用程序(我不能在这里分享(。它总是按预期在我的任何一台电脑上启动。除了旧版本的.NET Framework之外,它没有任何特定的依赖项。该软件多年来一直没有更改,我最近也没有对系统进行任何更改。

问题-第1部分

我通过辅助计算机上的远程桌面使用此实用程序。我不确定发生了什么,但explorer.exe崩溃了,我不得不重新启动计算机。

从那以后,这个实用程序就不再在那台计算机上启动了。我的意思是,当我点击/双击它的图标时,鼠标光标短暂地显示";加载";州,然后什么都没有。它在其他计算机上仍然运行良好。

感觉这台给定的计算机决定阻止该给定的实用程序?(我一点也不确定,这是现在计算机能做的事情吗?(

我该如何诊断和解决此问题?

注意:我在SuperUser上发布这篇文章和在这里发布之间犹豫了一下,因为这看起来像是一个系统问题,但它看起来像是.NET Framework特有的问题,所以我在这里发布了它

已经尝试过的东西

  • 我尝试卸载并重新安装该应用程序
  • 该系统受到Nod32 AntiVirus的保护,但我没有迹象表明它与该问题有关。我试着关闭防病毒软件,但这并没有改变任何事情,应用程序仍然没有启动
  • 我当然试着重新启动电脑了

问题-第2部分

在Windows 10Event Viewer > Windows Logs > Applications中,我发现了以下条目(后面是其他3个相关条目,但这一个似乎是最相关的(。这个系统似乎是Xml parsing的一个反复出现的问题?在解析应用程序配置时?(即使在重新安装应用程序之后。(这是怎么回事?我该如何解决?

Application: [MyApplication].exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Xml.XmlException
at System.Xml.XmlTextReaderImpl.Throw(System.Exception)
at System.Xml.XmlTextReaderImpl.ParseText(Int32 ByRef, Int32 ByRef, Int32 ByRef)
at System.Xml.XmlTextReaderImpl.ParseText()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at 
System.Configuration.XmlUtil.StrictReadToNextElement(System.Configuration.ExceptionAction)
at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(System.Configuration.XmlUtil, System.String, Boolean, System.String, System.Configuration.OverrideModeSetting, Boolean)
at System.Configuration.BaseConfigurationRecord.ScanSectionsRecursive(System.Configuration.XmlUtil, System.String, Boolean, System.String, System.Configuration.OverrideModeSetting, Boolean)
at System.Configuration.BaseConfigurationReco
rd.ScanSections(System.Configuration.XmlUtil)
at System.Configuration.BaseConfigurationRecord.InitConfigFromFile()
Exception Info: System.Configuration.ConfigurationErrorsException
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean)
at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(System.Configuration.ConfigurationSchemaErrors)
at System.Configuration.ClientConfigurationSystem.OnConfigRemoved(System.Object, System.Configuration.Internal.InternalConfigEventArgs)
Exception Info: System.Configuration.ConfigurationErrorsException
at System.Configuration.ClientConfigurationSystem.OnConfigRemoved(System.Object, System.Configuration.Internal.InternalConfigEventArgs)
at System.Configuration.Internal.InternalConfigRoot.OnConfigRemoved(System.Configuration.Internal.InternalConfigEventArgs)
at System.Configuration.Internal.InternalConfigRoot.RemoveConfigImpl(System.String, System.Configuration.BaseConfigurationRecord)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(System.String, Boolean, Boolean, Boolean, Boolean, System.Object ByRef, System.Object ByRef)
at System.Configuration.BaseConfigurationRecord.GetSection(System.String)
at System.Configuration.ConfigurationManager.GetSection(System.String)
at System.Configuration.ClientSettingsStore.ReadSettings(System.String, Boolean)
at System.Configuration.LocalFileSettingsProvider.GetPropertyValues(System.Configuration.SettingsContext, System.Configuration.SettingsPropertyCollection)
at System.Configuration.SettingsBase.GetPropertiesFromProvider(System.Configuration.SettingsProvider)
at System.Configuration.SettingsBase.GetPropertyValueByName(System.String)
at System.Configuration.SettingsBase.get_Item(System.String)
at System.Configuration.ApplicationSettingsBase.GetPropertyValue(System.String)
at System.Configuration.ApplicationSettingsBase.get_Item(System.String)
at [MyApplication].UI.WinForms.Properties.Settings.get_UnrarExePath()
at [MyApplication].Archive_tester_main_Form..ctor()
at [MyApplication].Program.Main()

我在一台启动应用程序的计算机上检查过,没有任何问题,在另一台计算机上没有这样的条目。

下一个想法我怀疑这个XML存储在系统中的某个地方,但我不确定在哪里。它似乎不是应用程序文件夹中的.config文件。

配置文件有时会损坏,并在加载设置时出现类似这样的异常。以这个问题为例。可能您的卸载程序没有删除用户设置,并且它已损坏。

在AppData(在应用程序的目录中(中查找user.config,然后查看它的样子。

最新更新