{"__v":0,"_id":"57910118ff09520e00d981b1","category":{"__v":0,"_id":"57909a453b845d0e006a37d5","project":"547cd7662eaee50800ed1089","version":"547cd7662eaee50800ed108c","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-21T09:47:49.247Z","from_sync":false,"order":1,"slug":"getting-started-windows-framework","title":"Get Started: Windows Apps"},"parentDoc":null,"project":"547cd7662eaee50800ed1089","user":"547cd6ac78fd57080023ca99","version":{"__v":9,"_id":"547cd7662eaee50800ed108c","project":"547cd7662eaee50800ed1089","createdAt":"2014-12-01T21:02:30.851Z","releaseDate":"2014-12-01T21:02:30.851Z","categories":["547cd7672eaee50800ed108d","54c8f8ae0174630d00efa874","54c8f8bd7a11f60d0022a832","54c8f8c60174630d00efa876","54c8f8f10174630d00efa877","55155826bc466623002afe83","551558324c7c1e39003735a0","56052058e266000d008971c7","57909a453b845d0e006a37d5"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-21T17:06:32.074Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"1. Take the steps described in [Integrate DevMateKit](doc:integrate-devmatekit) if you haven't done it yet.\n2. You can specify additional `DMFrameworkSettings` properties if needed. DevMate Crash Report provides the following configuration options:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`IsBeta`\",\n    \"1-0\": \"`ApplicationSettings`\",\n    \"2-0\": \"`AdditionalInfromation`\",\n    \"3-0\": \"`ApplicationIcon`\",\n    \"4-0\": \"`LogFilePath`\",\n    \"5-0\": \"`Logs`\",\n    \"5-1\": \"string\",\n    \"4-1\": \"string\",\n    \"3-1\": \"string\",\n    \"2-1\": \"string\",\n    \"1-1\": \"Dictionary<string,object>\",\n    \"0-1\": \"bool\",\n    \"0-2\": \"Specifies whether a current version of the application is Beta.\",\n    \"1-2\": \"Application settings that must be sent with the report data.\",\n    \"2-2\": \"Additional information that must be sent with the report data.\",\n    \"3-2\": \"Sets a “TitleBar” icon for DevMate Framework windows. Must contain at least one 16x16pt icon. Example: *pack://application:,,,/TestApp;component/icon.ico*.\",\n    \"4-2\": \"Path to a log file (if there is a number of log files, it sends only the recently used). If a value is null or empty, or file does not exist, then the Framework tries to load a file from the `Logs` property.\",\n    \"5-2\": \"Used to set up specific logs if a `LogFilePath` value is null or empty. If a value is null or empty, an empty string is sent to the server.\"\n  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]\nFor example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"DMFeedbackFrameworkSettings.ApplicationSettings.Add(\\\"Setting1\\\", \\\"Value1\\\"); \\nDMFeedbackFrameworkSettings.ApplicationSettings.Add(\\\"Language\\\", \\\"en\\\"); \\nDMFeedbackFrameworkSettings.ApplicationSettings.Add(\\\"AppRunCount\\\", 0); \\nDMFeedbackFrameworkSettings.ApplicationSettings.Add(\\\"Setting2\\\", \\\"Value2\\\");  \\n\\nDMFeedbackFrameworkSettings.LogFilePath = :::at:::\\\"C:\\\\Program Files\\\\AppName\\\\Logs\\\\logfile.log\\\";\\nDMFeedbackFrameworkSettings.AdditionalInformation = \\\"Version with hidden feature\\\";\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n#Crashes\nThis report type is generally used to notify about unhandled exceptions.\nTo subscribe for unhandled exceptions:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"App.Current.DispatcherUnhandledException += CurrentOnDispatcherUnhandledException;\\nAppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;\\nTaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;\\n\\t\\t\\t\\t\\t\\n...\\n \\nprivate void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)\\n{\\n\\tDMFeedbackWindowController.BigIconSource = “pack://application:,,,/Images/icon.png\\\";\\n\\tDMFeedbackWindowController.ShowCrashReportDialog(e.Exception);  \\n}    \\nprivate void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)  \\n{\\n  \\tDMFeedbackWindowController.BigIconSource = “pack://application:,,,/Images/icon.png\\\";\\n  \\tDMFeedbackWindowController.ShowCrashReportDialog(e.ExceptionObject as Exception);\\n}\\nprivate void CurrentOnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)  \\n{\\n  \\tDMFeedbackWindowController.BigIconSource = “pack://application:,,,/Images/icon.png\\\";\\n\\tDMFeedbackWindowController.ShowCrashReportDialog(e.Exception);  \\n}\\n\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n#Exceptions\nGenerally, this type of a report is used to show non-critical exceptions handled with “try-catch” statement.\nFor example:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"try  \\n{\\n  \\tDirectory.CreateDirectory(“testFolder”);  \\n}  \\ncatch (Exception ex)  \\n{\\n  \\tTrace.TraceError(\\\"Could not create folder”);a\\n  \\tDMFeedbackWindowController.BigIconSource = “pack://application:,,,/Images/icon.png\\\";\\n  \\tDMFeedbackWindowController.ShowCrashReportDialog(ex, FeedbackTypes.Exception);  \\n}\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"add-crash-report","type":"basic","title":"Configure Crash Reporting"}

Configure Crash Reporting


1. Take the steps described in [Integrate DevMateKit](doc:integrate-devmatekit) if you haven't done it yet. 2. You can specify additional `DMFrameworkSettings` properties if needed. DevMate Crash Report provides the following configuration options: [block:parameters] { "data": { "h-0": "Property", "h-1": "Type", "h-2": "Description", "0-0": "`IsBeta`", "1-0": "`ApplicationSettings`", "2-0": "`AdditionalInfromation`", "3-0": "`ApplicationIcon`", "4-0": "`LogFilePath`", "5-0": "`Logs`", "5-1": "string", "4-1": "string", "3-1": "string", "2-1": "string", "1-1": "Dictionary<string,object>", "0-1": "bool", "0-2": "Specifies whether a current version of the application is Beta.", "1-2": "Application settings that must be sent with the report data.", "2-2": "Additional information that must be sent with the report data.", "3-2": "Sets a “TitleBar” icon for DevMate Framework windows. Must contain at least one 16x16pt icon. Example: *pack://application:,,,/TestApp;component/icon.ico*.", "4-2": "Path to a log file (if there is a number of log files, it sends only the recently used). If a value is null or empty, or file does not exist, then the Framework tries to load a file from the `Logs` property.", "5-2": "Used to set up specific logs if a `LogFilePath` value is null or empty. If a value is null or empty, an empty string is sent to the server." }, "cols": 3, "rows": 6 } [/block] For example: [block:code] { "codes": [ { "code": "DMFeedbackFrameworkSettings.ApplicationSettings.Add(\"Setting1\", \"Value1\"); \nDMFeedbackFrameworkSettings.ApplicationSettings.Add(\"Language\", \"en\"); \nDMFeedbackFrameworkSettings.ApplicationSettings.Add(\"AppRunCount\", 0); \nDMFeedbackFrameworkSettings.ApplicationSettings.Add(\"Setting2\", \"Value2\"); \n\nDMFeedbackFrameworkSettings.LogFilePath = @\"C:\\Program Files\\AppName\\Logs\\logfile.log\";\nDMFeedbackFrameworkSettings.AdditionalInformation = \"Version with hidden feature\";", "language": "csharp" } ] } [/block] #Crashes This report type is generally used to notify about unhandled exceptions. To subscribe for unhandled exceptions: [block:code] { "codes": [ { "code": "App.Current.DispatcherUnhandledException += CurrentOnDispatcherUnhandledException;\nAppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;\nTaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;\n\t\t\t\t\t\n...\n \nprivate void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)\n{\n\tDMFeedbackWindowController.BigIconSource = “pack://application:,,,/Images/icon.png\";\n\tDMFeedbackWindowController.ShowCrashReportDialog(e.Exception); \n}   \nprivate void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) \n{\n \tDMFeedbackWindowController.BigIconSource = “pack://application:,,,/Images/icon.png\";\n \tDMFeedbackWindowController.ShowCrashReportDialog(e.ExceptionObject as Exception);\n}\nprivate void CurrentOnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) \n{\n \tDMFeedbackWindowController.BigIconSource = “pack://application:,,,/Images/icon.png\";\n\tDMFeedbackWindowController.ShowCrashReportDialog(e.Exception); \n}\n", "language": "csharp" } ] } [/block] #Exceptions Generally, this type of a report is used to show non-critical exceptions handled with “try-catch” statement. For example: [block:code] { "codes": [ { "code": "try \n{\n \tDirectory.CreateDirectory(“testFolder”); \n} \ncatch (Exception ex) \n{\n \tTrace.TraceError(\"Could not create folder”);a\n \tDMFeedbackWindowController.BigIconSource = “pack://application:,,,/Images/icon.png\";\n \tDMFeedbackWindowController.ShowCrashReportDialog(ex, FeedbackTypes.Exception); \n}", "language": "csharp" } ] } [/block]