Skip to content

UNT0008 fixes do not function in VS 2026 (at least since 18.4.x) #468

Description

@DorCoMaNdO

Bug description

UNT0008 appears when null coalescing is used on Unity objects, this functions the same on VS 2022 and VS 2026, however on VS 2026, when attempting to use the lightbulb fix, no preview is presented, nor do any of the confirmation options (single instance fix, as well as "Fix all occurrences in") do anything.

  • Version of analyzers assembly: Whichever was/is distributed with VS 2026 since at least 18.4.x up to 18.6.1 (current latest stable release)
  • Analyzer rule: UNT0008
  • Error (exception message, type, and callstack where applicable): N/A

To Reproduce

Steps or code to reproduce the behavior:

  1. Have the analyzer present a warning for UNT0008
  2. Perform null coalescing on a Unity object
  3. Attempt to fix via the lightbulb solution (without AI)

Expected behavior

The fix option should present a preview for the single instance fix and for "Fix all occurrences in", as well as actually perform the fix.

Screenshots

Image

Additional context

Other issues such as UNT0026 (also set to present a warning) do have functional fixes, however I'm not sure if that's true for all of them.
I'm not also sure if this needs to be reported here or as a VS feedback (or if it should be mirrored), if it's the latter then let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions