You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
UNT0008 fixes do not function in VS 2026 (at least since 18.4.x) #468
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:
Have the analyzer present a warning for UNT0008
Perform null coalescing on a Unity object
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
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.
It was properly working for simple members like transform?.transform but silently returning the unchanged document for everything else like invocations, chains, indexers, causing the VS lightbulb to be a no-op.
Activity
sailro commentedon Jun 2, 2026
Hello Dor (@DorCoMaNdO) and sorry for the delay, I missed this one.
I reproduce the issue with:
So I guess we have a bug directly in the analyzer. Having a look right now.
sailro commentedon Jun 2, 2026
OK I found and fixed the issue.
It was properly working for simple members like
transform?.transformbut silently returning the unchanged document for everything else like invocations, chains, indexers, causing the VS lightbulb to be a no-op.We should now support all constructs.
Thank you for this report.
Regards
Fixes UNT0008 (microsoft#473)