You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We faced application crash on MacOS when user does not have access to .config directory.
There is an exception System.UnauthorizedAccessException Access to the path '/Users/silentum/.config/MyCoolApp/MyCoolApp/NetSparkleUpdater' is denied.
To reproduce this issue I removed .config and then created it as root with chmod 0707.
In our code we do StartLoop(true, true, TimeSpan.FromMinutes(30)) on SparkleUpdater object
We susspect that this is because async void OnWorkerDoWork is throwing exception and we are unable to catch it. (change to async Task could solve this issue).
There is also no catch for System.IO exception in JSONConfiguration.GetSavePath when creating directory which could prevent this crash.
Crash call stack:
JSONConfiguration.cs in string JSONConfiguration.GetSavePath() at line 122
JSONConfiguration.cs in new JSONConfiguration(IAssemblyAccessor assemblyAccessor, string savePath) x 2 at line 51
SparkleUpdater.cs in Configuration SparkleUpdater.get_Configuration() at line 258
SparkleUpdater.cs in async void SparkleUpdater.OnWorkerDoWork(object sender, DoWorkEventArgs e) at line 1921
The text was updated successfully, but these errors were encountered:
You may want to consider upgrading to .NET 8, as at that time they updated the folder that Environment.SpecialFolder.ApplicationData points to (see docs here), which should be more reliable.
That being said, I have:
If the default folder for JSONConfiguration cannot be found, tries two other locations in hopes that one is usable.
If JSONConfiguration fails to be created, creates a DefaultConfiguration object, which basically does nothing special.
Noted in UPGRADING.md about what might happen on an upgrade of one's app to .NET 8+.
We faced application crash on MacOS when user does not have access to .config directory.
There is an exception
System.UnauthorizedAccessException
Access to the path '/Users/silentum/.config/MyCoolApp/MyCoolApp/NetSparkleUpdater' is denied.
To reproduce this issue I removed .config and then created it as root with chmod 0707.
In our code we do
StartLoop(true, true, TimeSpan.FromMinutes(30))
onSparkleUpdater
objectWe susspect that this is because
async void OnWorkerDoWork
is throwing exception and we are unable to catch it. (change toasync Task
could solve this issue).There is also no catch for
System.IO
exception inJSONConfiguration.GetSavePath
when creating directory which could prevent this crash.Crash call stack:
The text was updated successfully, but these errors were encountered: