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

Fixed issues #26, #31, #33 where running multiple instances cause var… #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JimiC
Copy link

@JimiC JimiC commented Oct 22, 2015

…ious exceptions to be thrown.

…re running multiple instances cause various exceptions to be thrown.
@JimiC
Copy link
Author

JimiC commented Oct 22, 2015

  1. Fixed Exception #26 by adding exception handler and debug logger when UnauthorizedAccessException is thrown.
  2. Fixed Exception on Start() #31 by modifying the 'Save' logic to not be asynchronous, in order for the settings to get saved before the process exits, avoiding creating malformed CSharpAnalytics-MeasurementQueue file.
  3. Fixed Starting multiple instances of a WPF application at same time throws Exception in Start() #33 by modifying the 'Save' logic to not be asynchronous, avoiding thread race between multiple instances.

@damieng In the process of fixing the issues I changed the way the library saves and reads the storage files. Used XmlWriter in order to produce a line intended file which makes it more readable. If this is an issue please let me know so to revert those changes.

memoryStream.Seek(0, SeekOrigin.Begin);

return (T)serializer.ReadObject(memoryStream);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect this changes the underlying format? If so then this change causes all clients to use their current information and be treated as new users again :(

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In matter of fact it doesn't change anything regarding the data. The previous format was a non-intended xml and by using XmlWriterSettings it produces an intended xml. The serializer (DataContractSerializer) didn't changed thus the objects get serialized and deserialized as before.

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

Successfully merging this pull request may close these issues.

2 participants