Skip to content

NullReferenceException when debugging DateTime related code #608

@patrick-haldi

Description

@patrick-haldi

Details about Problem

nanoFramework area: ( Visual Studio extension )

VS version: 15.9.22

VS extension version: 2017.1.8.16

Target: STM32F769I_DISCOVERY

Firmware image version:

Device capabilities output:
device_cap.txt
Assemblies:
CoreLibrary: v1.7.2-preview.5
Runtime.Native: v1.2.0-preview.15

Description

Visual Studio "Autos" window causes System.NullReferenceException in mscorlib.

Detailed repro steps so we can see the same problem

  1. make sure the target has the newest firmware (
    ST_STM32F769I_DISCOVERY-1.4.0-preview.181.zip
    ), and the VS project has the abovementioned assemblies referenced.

  2. open RTC test program:
    test_program.zip

  3. start debugging session

  4. make sure "Autos" window is closed

  5. set breakpoint, for example at line "Thread.Sleep(5000);", wait until it stops there

  6. nothing bad should happen - remove breakpoint and press continue

  7. let run for some time (15 s or so)

  8. enable "Autos" window (Debug->Windows->Autos)

  9. set same breakpoint as before, let it run into it

  10. remove breakpoint and press continue

  11. now, a "System.NullReferenceException" should happen in DateTime.cs

Other suggested things

Expected behaviour

No exception should be thrown.

Screenshot

grafik

Additional context

Make an effort to fix the bug

Our fix for the moment is to keep the "Autos" window closed. If I would have to guess about the cause of the issue, I would say it's because the debugger wants to generate a string representation for the debug output.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions