emuikernel / wittytwitter

Automatically exported from code.google.com/p/wittytwitter
1 stars 0 forks source link

Error on first run after upgrade from 0.1.5 to 0.1.6 #77

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Running 0.1.5 release
2. Install 0.1.6 beta from setup
3. Launch Witty (or use run after setup option)

What is the expected output? What do you see instead?
Expected program to run. Instead, got "Witty has encountered an error and 
will now close.

Debugged and got the following exception. Believe issue is due to 
upgrading settings - can we trap or prevent this exception?

System.Configuration.ConfigurationErrorsException was unhandled
  Message="Root element is missing. 
(C:\\Users\\Jong\\AppData\\Local\\Witty\\Witty.exe_Url_1eesninsky2lg4ylmbbm
gafdu53fv5rh\\0.1.5.30595\\user.config)"
  Source="System.Configuration"
  BareMessage="Root element is missing."

Filename="C:\\Users\\Jong\\AppData\\Local\\Witty\\Witty.exe_Url_1eesninsky2
lg4ylmbbmgafdu53fv5rh\\0.1.5.30595\\user.config"
  Line=0
  StackTrace:
       at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors
(Boolean ignoreLocal)
       at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors
(ConfigurationSchemaErrors schemaErrors)
       at System.Configuration.Configuration..ctor(String locationSubPath, 
Type typeConfigHost, Object[] hostInitConfigurationParams)
       at System.Configuration.ClientConfigurationHost.OpenExeConfiguration
(ConfigurationFileMap fileMap, Boolean isMachine, ConfigurationUserLevel 
userLevel, String exePath)
       at 
System.Configuration.ConfigurationManager.OpenExeConfigurationImpl
(ConfigurationFileMap fileMap, Boolean isMachine, ConfigurationUserLevel 
userLevel, String exePath)
       at 
System.Configuration.ConfigurationManager.OpenMappedExeConfiguration
(ExeConfigurationFileMap fileMap, ConfigurationUserLevel userLevel)
       at System.Configuration.ClientSettingsStore.ReadSettingsFromFile
(String configFileName, String sectionName, Boolean isUserScoped)
       at 
System.Configuration.LocalFileSettingsProvider.GetSettingValuesFromFile
(String configFileName, String sectionName, Boolean userScoped, 
SettingsPropertyCollection properties)
       at System.Configuration.LocalFileSettingsProvider.Upgrade
(SettingsContext context, SettingsPropertyCollection properties, Boolean 
isRoaming)
       at System.Configuration.LocalFileSettingsProvider.Upgrade
(SettingsContext context, SettingsPropertyCollection properties)
       at System.Configuration.ApplicationSettingsBase.Upgrade()
       at Witty.App.OnStartup(StartupEventArgs e)
       at System.Windows.Application.<.ctor>b__0(Object unused)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall
(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object 
source, Delegate callback, Object args, Boolean isSingleParameter, 
Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at 
System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext
(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at 
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCle
anup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext 
executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext 
executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, 
Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr 
wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall
(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object 
source, Delegate callback, Object args, Boolean isSingleParameter, 
Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl
(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object 
args, Boolean isSingleParameter)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority 
priority, Delegate method, Object arg)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, 
IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl
(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame 
frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at Witty.App.Main()
  InnerException: System.Xml.XmlException
       Message="Root element is missing."
       Source="System.Xml"
       LineNumber=0
       LinePosition=0
       SourceUri=""
       StackTrace:
            at System.Xml.XmlTextReaderImpl.Throw(Exception e)
            at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String 
res)
            at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
            at System.Xml.XmlTextReaderImpl.Read()
            at System.Xml.XmlTextReader.Read()
            at System.Configuration.XmlUtil..ctor(Stream stream, String 
name, Boolean readToFirstElement, ConfigurationSchemaErrors schemaErrors)
            at 
System.Configuration.BaseConfigurationRecord.InitConfigFromFile()
       InnerException: 

Original issue reported on code.google.com by jongallo...@gmail.com on 7 Feb 2008 at 9:17

GoogleCodeExporter commented 8 years ago
Viewed user.config file listed in exception - it was full of null characters. I 
think we should detect corrupted config and wipe it out.

Original comment by jongallo...@gmail.com on 7 Feb 2008 at 9:19

GoogleCodeExporter commented 8 years ago
I had an 0.1.2 and an 0.1.5 config after running the install (when I got the 
error). 
I deleted the 0.1.5 folder after verifying that the config file was full of 
null 
characters. After that, I was able to run the program and a new 0.1.6 folder 
was 
created with readable settings.

Original comment by jongallo...@gmail.com on 7 Feb 2008 at 9:22

GoogleCodeExporter commented 8 years ago
Thanks for finding and reporting this. Good thing we're still just a beta ;-).

Original comment by alan...@gmail.com on 7 Feb 2008 at 6:02

GoogleCodeExporter commented 8 years ago
Is this still an issue?

Original comment by alan...@gmail.com on 19 Mar 2008 at 1:03

GoogleCodeExporter commented 8 years ago
Yes. I have encountered this issue (corrupted user.config) on two different
installations of 0.1.7 Beta 1 (one on Vista Ultimate x64 and one on Vista 
Enteprise
x86).  Note that I have not had any version other than 0.1.7 Beta 1 installed on
either machine.

Original comment by nino.ben...@gmail.com on 5 Apr 2008 at 2:46

GoogleCodeExporter commented 8 years ago
Update to my last comment (comment 5):  After additional forensics, I am 
confident 
in stating that my user.config became corrupted after an OS crash. On the x64 
box, 
the crash was an unexpected shutdown and on the x86 box it was a BSOD.

Original comment by nino.ben...@gmail.com on 6 Apr 2008 at 12:29

GoogleCodeExporter commented 8 years ago
This is for an old version, not seeing it anymore

Original comment by jongallo...@gmail.com on 14 Dec 2008 at 6:52

GoogleCodeExporter commented 8 years ago
Was able to reproduce. Here's some code to detect and remove a corrupted 
user.config: http://www.codeproject.com/KB/dotnet/CorruptUserConfig.aspx

Original comment by jongallo...@gmail.com on 27 Dec 2008 at 4:48

GoogleCodeExporter commented 8 years ago
I've checked in the fix - will test once it's released in the ClickOnce version

Original comment by jongallo...@gmail.com on 28 Dec 2008 at 5:46