'How to fix IDE complaints about IDE0059 without restarting?

My Visual Studio complains about an unnecessary assignment of a value to a variable, IDE0059.

VS Screenshot of IDE0059

My code (part of a unit test) is

var result = parser.Parse(Resource.String1);
Assert.AreEqual("-6:00", result.DailyTimeBalance);

and IMHO the variable is clearly used after the assignment.

What could I do to get rid of this false positive without restarting Visual Studio?

I have tried:

  • rebuilding the unit test project - does not help
  • unloading the unit test project and reloading it - does not help
  • restarting Visual Studio - helps

I'm using Visual Studio 2019 Version 16.11.10



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source