Repository navigation
Description
Exception: System.UnauthorizedAccessException
Message: Access to the path 'C:\Users\jcameron\AppData\Roaming\MangoApps\CSharpAnalytics-MeasurementSession' is denied.
Stack:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
at CSharpAnalytics.Serializers.AppDataContractSerializer.d__71.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at CSharpAnalytics.WinFormAutoMeasurement.<Save>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at CSharpAnalytics.BaseAutoMeasurement.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.b__0(Object state) < Less
Activity
damieng commentedon Dec 4, 2014
Is this in a WPF or WinForms application?
ankur4747github commentedon Dec 5, 2014
WPF
JimiC commentedon Oct 22, 2015
Access to write to the folder is denied due to write access constrains. Have seen that many times happening. Issue gets resolved if application is running with elevated privileges a.k.a. 'Run as administrator'.
@damieng I think this issue can be closed.
xmedeko commentedon Oct 22, 2015
IO problems in a logging library like
CSharpAnalyticsshould not crash the whole app. The library has to log error and keep going. It should be robust. E.g. look at classic logging libraries like (log4net)[https://logging.apache.org/log4net/] etc. They also do not crash the app even when they cannot work (write to disk).JimiC commentedon Oct 22, 2015
I'm not sure if this library should "swallow" IO errors without giving any indication that something went wrong. I'll leave it up to @damieng.
xmedeko commentedon Oct 22, 2015
Swallow and log error is ok. I suggest to use some custom or existing logging facade, initialized by a static property. (Default initialization by no logging or console logging class). Debug log and error log would be enough for now.
Fixed issues AttackPattern#26, AttackPattern#31, AttackPattern#33 whe…