I'm new to Win RT development and I'm currently developing a windows RT app in which I've sent a debug build of my app to the tester. I'm wondering where can I find the output of the debug messages? Would it be possible to redirect the debug output to a file?
I assume you use the system.diagnostics.debug to output the debug info.
In the desktop version .NET, you can add the Debug.Listeners to catch the log and output to file. But in the .NET for Store App, you can not add file listener.
The alternative way to log is using ETW (Event Tracing for Windows).
Code Sample: Logging Sample for Windows Store Apps (ETW Logging in WinRT)
The blog HOW TO WRITE LOG FILES IN WINDOWS STORE APPS also introduced several ways to log in Windows Store App.
Related
I'm using fiddler as proxy to get download URL of Windows Store apps.
Most of the time after catching URL, download appx/appxbundle and open it, windows show error 'Cannot open appx/appxbundle file'.
When I want to open appx using WinRar, faced with error 'Unknown format or damaged'. also i checked the error in Windows Powershell and see error 0x80073cf0.
I'm pretty sure, appx file downloaded completely but why cannot install app.
APPX files downloaded from the store are encrypted so you can't just download an app and extract it's contents. This is just a part of the various mechanisms in place to protect the Intellectual Property of the those creating and releasing apps.
I'm thinking of porting a desktop file launcher app to the Windows 10 store app.
So being a program launcher it would need unrestricted access to ANY folder/path/exe on the users system, it's a configurable program/argument launcher. Basically global file system access. Is this possible without the user having to choose anything?
For example the app could call: notepad.exe "f:\data\test.txt"
or: c:\program files\adobo\photoshock\photo.exe "g:\data\test.tiff"
No, UWP apps have limited access to the file system by design.
You may want to try converting you desktop app into a "modern" desktop app thru the Project Centennial.
How can we log exceptions and error for windows Phone8.0 app
I also want a mechanism to delete the logs after a period of time
Is there a method other than ISO to log error
thanks in advance
Write them to files in isolated storage. You can write code to iterate over the file system to clean them up. If this is just for testing use Windows Phone Power Tools to manually remove logs.
An alternative is to build a logging service and have your devices connect and write to it when they have a data connection.
we have a windows 8.1 app in the windows store that sometimes crashes or hangs and we are unable to receive reports about hangs and crashs reported by the user via the store.
Collecting of telemetriy data is enabled in the store like mentioned in this MSDN-Article(http://msdn.microsoft.com/en-us/library/windows/apps/hh967787.aspx).
So I did a crash of the app by myself, took a look in the WER-ReportArchive(%localappdata%\Microsoft\Windows\Windows Error Reporting) and found a .cab & .wer-file. So I think the report was sended to microsoft, but theres still no crash or hang documented in the Dashboard of the App Store.
I tried to get a crashdump via Windows Error Reporting - LocalDumps (msdn.microsoft.com/en-us/library/ bb787181%28VS.85%29.aspx), but this dump is only generated when an error occurs.
In my case mostly the app just hangs!
I also tried to configure Windows Error Report - Registry Entries (http://msdn.microsoft.com/en-us/library/bb513638%28VS.85%29.aspx), but it seems most of the entries are just ignored.
I noticed WER is creating a dump-file of AppHangs as well, before sending the data to Microsoft (memory.hdmp in ReportQueue). But this files are deleted immediately after sending.
Does somebody know a way to get memory dumps and further information for AppHangs as well?
Thanks in Advance.
I think you could use the posibility of Just-In-Time or postmortem debugging via setting registry key for AeDebug, if you can create the crash.
Have a look at:
Improving apps with Quality reports
https://blogs.msdn.microsoft.com/windowsstore/2012/06/27/improving-apps-with-quality-reports/
Debugging a Windows 8.1 Store App Crash Dump
https://blogs.msdn.microsoft.com/ntdebugging/2014/01/13/debugging-a-windows-8-1-store-app-crash-dump/
Configuring Automatic Debugging https://msdn.microsoft.com/en-us/library/bb204634(vs.85).aspx
Using WER: Collecting User-Mode Dumps https://msdn.microsoft.com/en-us/library/bb787181(v=vs.85).aspx
Enabling JIT-Attach Debugging https://msdn.microsoft.com/en-us/library/2ac5yxx6.aspx
I have a WP8 App where I want to store the crash logs if and when generated.
Is there any way of fetching the crash dump file from Windows Phone 8 programmatically?
As far as I know, you can't retrieve the crash dumps that are automatically sent to the DevCenter. However, what you can do is subscribing to the global unhandled exception event handler, store the exception contents in the isolated storage, then do whatever you need with it (like sending it to a remote server). That's what many applications do, and it's even automated by some libraries (such as Telerik).
You can achieve that by using a logging system as MetroLog. You'll be able to collect these crash logs if you configure GlobalCrashHandler that will ensure that a FATAL log entry is written if an unhandled exception occurs.
You can install it using NuGet
Install-Package MetroLog
Here's an quick example:
using MetroLog;
using MetroLog.Targets;
LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new FileStreamingTarget());
GlobalCrashHandler.Configure();
ILogger log = LogManagerFactory.DefaultLogManager.GetLogger<MainPage>();
log.Trace("This is a trace message.");
You can find a tutorial explaining how to add it on your project at http://talkitbr.com/2015/06/11/adicionando-logs-em-universal-apps. Also there is an explanation regarding retrieving these logs.