I have an application build on Visual Studio 2013 with C# and Windows Forms.
This application runs on system tray and every 15 minutes (using a System.Windows.Forms.Timer component) visits a REST website, gets JSON data from it and displays them on the application.
The application is in Beta (i have it installed in a few clients for testing) and i was informed that very rarely, after computer recovers from sleep mode it will throw an exception (you can continue using it pressing the continue in the popup window as i was informed).
I have never seen this error in any of my development rigs (Windows 7 64bit, Windows 8.1 and then updated to Windows 10). The two clients that informed me about this exception were running Windows 7 32bit and 64bit.
I have seen this but what should i do when Mode is changed? Should i stop the Timer and then restart it when the Mode changes back to PowerModes.Resume?
As per the answer to this SO Post, Timer checks if any event has missed and fires accordingly. So the exception might be related to getting data from the REST website.
Maybe the exception occurs because your network card is turned off by the OS to save power. Try getting some details of the exception.
Related
my UWP runs fine on my PC, I downloaded it from store to check it on my pc and it runs fine, but it is crashing on certain other PCs for unknown reasons, it crashed on the splash screen and dev center is showing me following crash reports.
Please let me know how can I fix or handle these exceptions.
NOTE
"Fluenttt" is the namespace of my app project.
Also note that dev center has no data in log for these exceptions. or no stacktrace shown.
ARM can't be the reason of your crash. ARM package is for mobile device and if you don't upload it when you publish your app, your app won't be available to customer on mobile device in Store.
Without your app, it's hard to tell the reason just according to your failure name. But you could add an UnhandledException event to notify your app about exceptions encountered by the XAML framework or by Windows Runtime in general that haven't been handled by your app code.
Additionally, you could also use Custom event to log the event or activity in your app and you can review the occurrences for your custom events in the Custom Events section of the Usage report in dashboard.
I am developing UWP app (Windows 10) that record user voice through microphone. I need to prevent OS going in to sleep mode while the recording is in progress.
I already used below code to prevent screen lock.
var displayRequest = new Windows.System.Display.DisplayRequest();
displayRequest.RequestActive();
But it only works on mobile phone, tables. Desktop PC stills going on sleep mode.
Make sure the DisplayRequest object has a global scope. If you only define it within the function then it goes out of scope and gets released and the computer will go to sleep.
Hold on to the global object for as long as you need, and then call RequestRelease() on it when your done.
While recording is in progress, your app should also be in the foreground otherwise it will be considered inactive and screen will be locked even after executing displayRequest.RequestActive();.
An app is considered to be inactive (not running in the foreground) when:
Tablet mode: If your app is not focused then it is considered inactive
Desktop mode: If your app is minimized then it is considered inactive
For more details on this topic you can refer this blog post by windows app team.
I have a strange situation. My windowsphone 8 app build with Xamarin and MvvmCross runs perfect from my debugger (visual studio).
Then I submit the app to the app store (beta store by the way). After that I downloaded it on my device and started the app. The splashscreen shows off... but thats it (I waited for about 5 minutes). No crash and no other information about what happens.
When I then go back with my backbutton or my start-button and restart the app. Everything works fine. This situation only occurs on the first time I start my app after downloading from the store.
Question: Is there someone with same issues?
Question: Is there a tool or something which I can use to log the device to get some more information?
Thank you
Assuming you are submitting to the Windows Phone App Store and the OS on the phone running the app is greater than v7.0.7355., you should be able to retrieve the crash dump data from the Windows Phone Dev Centre.
This will only cover crashes within an application and not the underlying OS code.
For more information see: Crash count reports
Check you don't have any code in the debug-only section of the App.xaml.cs
e.g. if your init code sits inside a block starting if ( Debugger.IsAttached )
We have a automated printing service running as System account printing web urls.
The idea is using WebBrowser to load page and call Print upon it finished loading.
This works fine on Server 2003 , 2008r2 etc but does not work on Server 2012 ONLY IF it was running as a service. running as a console application works fine.
The problem:
It would load web pages fine and would call Print() , Print() will return but nothing gets printed on the default printer: no print job at all.
I thought it would be account problem so I tried to run service as the same logged on user but still does not work, if that user run application as console app then it would work fine. So default printer and user account get ruled out.
I don't think it is a code problem (it must be though) as it works for older Windows versions running as service.
It seems something fundamental got changed for a service process in server 2012.
Update 1. It may relates to How do I print an HTML document from a web service?
However it works fine for me prior server 2012.
Update 2. It does not work even the whole print happens in a separate process, i.e. my service launches a process to do print, it does not work either. Everything works fine if I run same code in console mode. It is definitely not a threading problem but rather something deep in server 2012.
Now the questions are:
What is changed? Why it stopped working?
At http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/fdcfa0fa-50aa-4a61-be79-5b4c8f65fbf7/ we see that this was reported to Microsoft and confirmed as a bug in Windows 8 and Windows Server 2012.
This bug is triggered when trying to print from a 32bit process in non-standard user session (like e.g. a service).
According to Microsoft, this a bug was resolved in Windows 8.1 and Windows Server 2012 R2. However, we could still reproduce it on Windows 8.1.
On the same site, a workaround is given by Microsoft. This workaround solved the problem for us on Windows 8.1. It probably also works on Windows 8 and Windows Server 2012.
The workaround goes as follows:
Open Regedit and go to HKEY_CLASSES_ROOT\CLSID{BA7C0D29-81CA-4901-B450-634E20BB8C34}
Check the value of the "AppID" Registry Entry. In our case this was {AA0B85DA-FDDF-4272-8D1D-FF9B966D75B0}
Now go to HKEY_CLASSES_ROOT\AppID{AA0B85DA-FDDF-4272-8D1D-FF9B966D75B0} (or the respective value you found on your system)
Under this registry key, delete the entries with the name "AccessPermission", "LaunchPermission" and "RunAs"
Since this is a bug in Windows, you cannot fix it in your code. The workaround might have side effects, but we haven't seen any so far in our scenario.
As i understand i can launch a PeriodicTask from my windows phone application. But will it be called after application is terminated? Or, most important, will it be called by system after device reboot (before user run the main app next time)?
Yeah, they will run after a reboot and when your application is terminated but Battery Save Mode can prevent execution.
Good introduction:
http://blogs.infosupport.com/blogs/alexb/archive/2011/05/26/multi-tasking-in-windows-phone-7-1.aspx