FortuneN / FineCodeCoverage

Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)
https://marketplace.visualstudio.com/items?itemName=FortuneNgwenya.FineCodeCoverage
Other
506 stars 38 forks source link

stopped working with VS 2022 (Version 17.9.0 Preview 2.1) #395

Closed jasells closed 4 months ago

jasells commented 4 months ago

Installed product versions

Description

The extension recently (since Jan 1, 2024) stopped working. Maybe after I updated VS, not sure?

Steps to recreate

  1. Nunit test project(s) targeting .Net Core 3.1
  2. Run tests in Test Explorer (succeed, no problems there)

Current behavior

From FCC output window:

Fine Code Coverage 2/22/2024 4:22:43 PM: Error processing unit test events
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> ReflectObject.PropertyDoesNotExistException: Property IsAborted with binding flags Instance, Public, NonPublic does not exist on Microsoft.VisualStudio.TestWindow.Messages.TestRunResponse
   at ReflectObject.PropertySetterBase`1.EnsureMemberExists()
   at ReflectObject.PropertySetterBase`1.Set(ReflectObjectProperties wrapper, Object reflectedObject)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at ReflectObject.PropertySetter.GetPropertyValue(ReflectObjectProperties wrapper, Object reflectedObject)
   at ReflectObject.PropertySetterBase`1.Set(ReflectObjectProperties wrapper, Object reflectedObject)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at FineCodeCoverage.Impl.TestOperationFactory.Create(IOperation operation)
   at FineCodeCoverage.Impl.TestContainerDiscoverer.<TestExecutionStartingAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at FineCodeCoverage.Impl.TestContainerDiscoverer.<OperationState_StateChangedAsync>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at FineCodeCoverage.Impl.TestContainerDiscoverer.<TryAndLogExceptionAsync>d__37.MoveNext()
Fine Code Coverage 2/22/2024 4:22:44 PM: Error processing unit test events
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> ReflectObject.PropertyDoesNotExistException: Property IsAborted with binding flags Instance, Public, NonPublic does not exist on Microsoft.VisualStudio.TestWindow.Messages.TestRunResponse
   at ReflectObject.PropertySetterBase`1.EnsureMemberExists()
   at ReflectObject.PropertySetterBase`1.Set(ReflectObjectProperties wrapper, Object reflectedObject)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at ReflectObject.PropertySetter.GetPropertyValue(ReflectObjectProperties wrapper, Object reflectedObject)
   at ReflectObject.PropertySetterBase`1.Set(ReflectObjectProperties wrapper, Object reflectedObject)
   at System.Collections.Generic.List`1.ForEach(Action`1 action)
   at FineCodeCoverage.Impl.TestOperationFactory.Create(IOperation operation)
   at FineCodeCoverage.Impl.TestContainerDiscoverer.ShouldConditionallyCollectWhenTestExecutionFinished(IOperation operation)
   at FineCodeCoverage.Impl.TestContainerDiscoverer.<TestExecutionFinishedAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at FineCodeCoverage.Impl.TestContainerDiscoverer.<OperationState_StateChangedAsync>d__36.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at FineCodeCoverage.Impl.TestContainerDiscoverer.<TryAndLogExceptionAsync>d__37.MoveNext()

Expected behavior

Show Coverage reports and output

Is it a known issue with this version of preview, or has anyone else seen it?

Great tool!

My Studio Professional 2022 (64-bit) - Version 17.8.4 install still works, so for the moment, I switch VS instances to do my unit testing as a work around...

tonyhallett commented 4 months ago

Duplicate of #364. This has been fixed please update the extension

jasells commented 4 months ago

Thanks!

Just for posterity, VS did not show any updates available, but manually uninstalling and reinstalling the extension updated it to 1.1.209, and did resolve things for me.