1

I just recently started with the Windows 10 IOT Core on the Raspberry Pi 3 and am currently writing my first applications. Everything went well so far, but I noticed, that while debugging an application, it doesn't end when it is supposed to do.

My very simple code looks like this:

public sealed class StartupTask : IBackgroundTask
{
    public void Run(IBackgroundTaskInstance taskInstance)
    {
        System.Diagnostics.Debug.WriteLine("Application started");
    }
}

When I deploy the app it launches and after a few skipped symbols loading the desired text appears in the debugging console. What I unsterstand is that the application then should terminate but instead it ends with code 1 after around 30 seconds to a minute.

Did I misunderstand something in the execution process or is this related to the debugging mode? And is there a possibility to end the application inside the code (e.g. if a condition holds, end the execution)?

  • IF you set the app to autostart, then IoT will restart the APP automatically every time is closes (or crashes) This is intentional. This code snippet you supplied is just a small piece of the puzzle.. it is likely the main app is calling this over and over.. probably for the reason I have told you. And the debugger is showing you this exactly as it is happening. The actual debugger will never change the behaviour of your program. If this is your entire app code (hello world).. then yes. It is likely being auto restarted... – Piotr Kula May 5 '17 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.