Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception #26

Open
ankur4747github opened this issue Oct 27, 2014 · 6 comments
Open

Exception #26

ankur4747github opened this issue Oct 27, 2014 · 6 comments

Comments

@ankur4747github
Copy link

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

@damieng
Copy link
Contributor

damieng commented Dec 4, 2014

Is this in a WPF or WinForms application?

@ankur4747github
Copy link
Author

WPF

@JimiC
Copy link

JimiC commented 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
Copy link

xmedeko commented Oct 22, 2015

IO problems in a logging library like CSharpAnalytics should 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
Copy link

JimiC commented 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
Copy link

xmedeko commented 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.

JimiC added a commit to JimiC/CSharpAnalytics that referenced this issue Oct 22, 2015
…re running multiple instances cause various exceptions to be thrown.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants