{"action":"created","issue":{"url":"https://api.github.com/repos/gitextensions/gitextensions/issues/2710","labels_url":"https://api.github.com/repos/gitextensions/gitextensions/issues/2710/labels{/name}","comments_url":"https://api.github.com/repos/gitextensions/gitextensions/issues/2710/comments","events_url":"https://api.github.com/repos/gitextensions/gitextensions/issues/2710/events","html_url":"https://github.com/gitextensions/gitextensions/issues/2710","id":62246440,"number":2710,"title":"[mono] An exception was thrown by the type initializer for GitCommands.AppSettings","user":{"login":"ArsenShnurkov","id":188456,"avatar_url":"https://avatars.githubusercontent.com/u/188456?v=3","gravatar_id":"","url":"https://api.github.com/users/ArsenShnurkov","html_url":"https://github.com/ArsenShnurkov","followers_url":"https://api.github.com/users/ArsenShnurkov/followers","following_url":"https://api.github.com/users/ArsenShnurkov/following{/other_user}","gists_url":"https://api.github.com/users/ArsenShnurkov/gists{/gist_id}","starred_url":"https://api.github.com/users/ArsenShnurkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArsenShnurkov/subscriptions","organizations_url":"https://api.github.com/users/ArsenShnurkov/orgs","repos_url":"https://api.github.com/users/ArsenShnurkov/repos","events_url":"https://api.github.com/users/ArsenShnurkov/events{/privacy}","received_events_url":"https://api.github.com/users/ArsenShnurkov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gitextensions/gitextensions/labels/linux/mono","name":"linux/mono","color":"DDDDDD"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-03-17T00:50:30Z","updated_at":"2015-11-30T15:11:23Z","closed_at":null,"body":"https://gist.github.com/ArsenShnurkov/d3c29df6d79c15171ea6\r\n\r\nSystem.TypeInitializationException: An exception was thrown by the type initializer for GitCommands.AppSettings ---> System.Xml.XmlException: Unexpected XML declaration. The XML declaration must be the first node in the document, and no white space characters are allowed to appear before it. Line 104, position 9.\r\n\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/9640637-mono-an-exception-was-thrown-by-the-type-initializer-for-gitcommands-appsettings?utm_campaign=plugin&utm_content=tracker%2F285320&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F285320&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/gitextensions/gitextensions/issues/comments/160656633","html_url":"https://github.com/gitextensions/gitextensions/issues/2710#issuecomment-160656633","issue_url":"https://api.github.com/repos/gitextensions/gitextensions/issues/2710","id":160656633,"user":{"login":"ArsenShnurkov","id":188456,"avatar_url":"https://avatars.githubusercontent.com/u/188456?v=3","gravatar_id":"","url":"https://api.github.com/users/ArsenShnurkov","html_url":"https://github.com/ArsenShnurkov","followers_url":"https://api.github.com/users/ArsenShnurkov/followers","following_url":"https://api.github.com/users/ArsenShnurkov/following{/other_user}","gists_url":"https://api.github.com/users/ArsenShnurkov/gists{/gist_id}","starred_url":"https://api.github.com/users/ArsenShnurkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArsenShnurkov/subscriptions","organizations_url":"https://api.github.com/users/ArsenShnurkov/orgs","repos_url":"https://api.github.com/users/ArsenShnurkov/repos","events_url":"https://api.github.com/users/ArsenShnurkov/events{/privacy}","received_events_url":"https://api.github.com/users/ArsenShnurkov/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T15:11:23Z","updated_at":"2015-11-30T15:11:23Z","body":"Is it so difficult to add links to things? It's hypertext, why do you use it like wooden book page, while referring to file and line by filename and line number?\r\n\r\nThe attribute added was <a href=\"https://github.com/gitextensions/gitextensions/commit/49a1a04d77f5178afb009a4074d12bbea8b6d8e5#diff-648d16515c7f2d7962ee0df48164fb1eR34\">Serializable</a>, not **I**Serializable\r\n\r\nhotkeys <a href=\"https://github.com/gitextensions/gitextensions/blob/fe4bb94ca2a74dbbe14348dc41e96284fecdbe06/GitUI/Hotkey/HotkeySettingsManager.cs#L112-L118\">converts itself to xml in method SaveSettings</a>, with a <a href=\"https://github.com/gitextensions/gitextensions/blob/fe4bb94ca2a74dbbe14348dc41e96284fecdbe06/GitUI/Hotkey/HotkeySettingsManager.cs#L17-L27\">XmlSerializer object</a>\r\n\r\nXmlSerializer can serialize objects of the specified type into XML documents, and deserialize XML documents into object of a specified type. If a property or field returns an <a href=\"https://msdn.microsoft.com/en-us/library/system.xml.serialization.xmlserializer.xmlserializer%28v=vs.110%29.aspx\">array</a>, the extraTypes parameter specifies objects that can be inserted into the array.\r\n\r\nXmlSerializer <a href=\"http://stackoverflow.com/a/12461510/1709408\">don't care</a> about SerializableAttribute\r\n\r\nThe usage of XmlSerializer explains, thy we see XML, but <b>doesn't explain why that fragment (for hotkeys) is escaped</b>.\r\n\r\nand I see a difference in the value of serializeAs attribute for \r\n<a href=\"https://github.com/gitextensions/gitextensions/blob/fe4bb94ca2a74dbbe14348dc41e96284fecdbe06/GitUI/app.config#L13\">Hotkeys</a> (String) and\r\n**WindowsPositions** (Xml):\r\n\r\n    <setting name=\"Hotkeys\" serializeAs=\"String\">\r\n    <setting name=\"WindowPositions\" serializeAs=\"Xml\">"}}