jastBytes / SyncthingTray

Syncthing wrapper for Windows. Includes a small interface to configure start on boot and puts syncthing into tray instead of the console window.
GNU General Public License v2.0
151 stars 24 forks source link

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

Open StefH opened 9 years ago

StefH commented 9 years ago

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 ?

jkaberg commented 9 years ago

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

StefH commented 9 years ago
  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 commented 7 years ago

Any update?