SyncthingTray icon indicating copy to clipboard operation
SyncthingTray copied to clipboard

Running the project results into fatal error due to empty/null ConfigPath

Open StefH opened this issue 10 years ago • 3 comments

I've forked latest code and when running the app using F5, I get an error in SyncthingConfig.cs that ConfigPath is null in this code:

static SyncthingConfig()
{
    Watcher = new FileSystemWatcher(Path.GetDirectoryName(ConfigPath))
    . . . 

Another question, did you use a generator to create the SyncthingConfig.cs file ? And why not just store these settings in the app.config ?

StefH avatar Feb 23 '15 07:02 StefH

I'm also seeing this when compiling,

2015-02-23 09:46:12,533 - FATAL [1][SyncthingTray.Program][27]: System.TypeInitializationException: Typeinitialiseringen for SyncthingTray.SyncthingConfig forårsaket et unntak. ---> System.ArgumentNullException: Verdien kan ikke være null. Parameternavn: path ved System.IO.FileSystemWatcher..ctor(String path, String filter) ved SyncthingTray.SyncthingConfig..cctor() i c:\Users\Joel\Desktop\SyncthingTray-master\SyncthingTray\SyncthingConfig.cs:linje 23 --- Slutten på sporingen av intern unntaksstakk --- ved SyncthingTray.SyncthingConfig.add_ConfigurationChanged(SyncthingConfigEventHandler value) ved SyncthingTray.Program.Main() i c:\Users\Joel\Desktop\SyncthingTray-master\SyncthingTray\Program.cs:linje 27

For the sake of sanity I've removed the old configs @ C:\Users\ user \AppData\Local\SyncthingTray before I ran the new build

jkaberg avatar Feb 23 '15 08:02 jkaberg

  1. The code is trying to read the config.xml from SyncThing, which maybe fails when you don't have SyncThing installed.
  2. The SyncthingConfig.cs is generated (I think) from the config.xml from SyncThing. I wonder if the SyncThing project also defines an .XSD ?

StefH avatar Feb 23 '15 19:02 StefH

Any update?

StefH avatar Oct 11 '17 19:10 StefH