0

The follow code is a simplistic example of the issue that I'm having. This was working fine on IoT Core but now when debugging it jumps over var personJson line and never sets a value. I've tested this same code in a blank UWP app and ran it fine on my desktop.

I'm running Windows IoT Core v.10.0.16299.371 on a Raspberry Pi3 B. I'm sure the code was working on v.10.0.16299.309.

Anyone have an idea of what may be happening?

public sealed class StartupTask : IBackgroundTask
{
    private BackgroundTaskDeferral deferral;

    public void Run(IBackgroundTaskInstance taskInstance)
    {
        deferral = taskInstance.GetDeferral();
        LoadPerson();
    }

    private void LoadPerson()
    {
        Person person = new Person();

        person.firstName = "John";
        person.lastName = "Doe";
        person.age = 21;

        var personJson = JsonConvert.SerializeObject(person, Formatting.Indented);
    }
}

public sealed class Person
{
    public string firstName { get; set; }
    public string lastName { get; set; }
    public int age { get; set; }
}
John Smith
  • 13
  • 3
  • I'm not sure what happened. After restarting the Pi it now works again. Very strange! – John Smith Apr 14 '18 at 16:50
  • Have you traced the event log for your Windows IoT Core? – Michael Xu Apr 16 '18 at 04:37
  • I did not and after restarting I'm not experiencing the issue any longer. Can you provide a link as to how I can learn to trace the event log in the future if it returns? It sounds like something I need to learn how to perform to be better informed. – John Smith Apr 19 '18 at 00:30
  • Please see this document(https://learn.microsoft.com/en-us/windows/uwp/debug-test-perf/device-portal#event-tracing-for-windows-etw-logging) and this topic(https://stackoverflow.com/questions/36673208/how-do-i-log-events-in-windows-iot). – Michael Xu Apr 19 '18 at 01:28

0 Answers0