flyingpie / windows-terminal-quake

Enable Quake-style dropdown for (almost) any application.
https://wtq.flyingpie.nl
MIT License
598 stars 39 forks source link

System.ArgumentException in WindowsTerminalQuake.Settings..cctor() #33

Closed LordLyng closed 4 years ago

LordLyng commented 4 years ago

Keep getting ArgumentExceptions when running the applciation. Happens both with the settings json next to the application, and in user folder.

Tried multiple versions.

Event Viewer exception details: Application: windows-terminal-quake.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.ArgumentException at System.IO.FileSystemWatcher..ctor(System.String, System.String) at WindowsTerminalQuake.Settings+<>c.<.cctor>b__9_0(System.String) at System.Linq.Enumerable+WhereSelectArrayIterator2[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext() at System.Collections.Generic.List1[[System.Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1<System.Canon>) at System.Linq.Enumerable.ToList[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089] at WindowsTerminalQuake.Settings..cctor()

Exception Info: System.TypeInitializationException at WindowsTerminalQuake.Settings.get_Instance() at WindowsTerminalQuake.Logging.Configure() at WindowsTerminalQuake.Program.Main(System.String[])

Should be due to invalid paths according to docs

flyingpie commented 4 years ago

@LordLyng Thank you for reporting this bug!

I've made some changes in the v0.11 release: https://github.com/flyingpie/windows-terminal-quake/releases/tag/v0.11.

This should make the app at least run, but perhaps the actual settings are not (correctly) loaded.

Could you add the following to the settings file:

{
    "Logging": true
}

Then run the app, and see if a "logs"-folder is created next to the .exe, with logs in there. Hopefully, that would shed some light on what is going on.

LordLyng commented 4 years ago

Thanks! But I'm not sure that logging is working as intended. The logging is depending on an instance of the SettingDto class, and the error happens within the static constructor. Which means that the error will still happen before logging is enabled.

Will clone and take a look-see later

flyingpie commented 4 years ago

@LordLyng Did you try that using the prerelease?

LordLyng commented 4 years ago

Didn't try it yet - it's late here, I'll look at it tomorrow. I just looked up the code on github and saw no apparent changes to the path resolution for the file watcher - didn't check the rest of it though, resilience might be there. I'll report back tomorrow

flyingpie commented 4 years ago

Fixed in v0.11.