Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to evaluate the data rule. Method not found: 'JetBrains.ReSharper.UnitTestFramework.Criteria.IUnitTestElementCriterion JetBrains.ReSharper.UnitTestFramework.Criteria.DisjunctiveCriterion.Fro.. #160

Closed
patiqs opened this issue Jan 3, 2022 · 8 comments

Comments

@patiqs
Copy link

patiqs commented Jan 3, 2022

JetBrains Rider 2021.3.2 Build RD-213.6461.51 Date 2021-12-22T16:40:05.465+0000

Failed to evaluate the data rule. Method not found: 'JetBrains.ReSharper.UnitTestFramework.Criteria.IUnitTestElementCriterion JetBrains.ReSharper.UnitTestFramework.Criteria.DisjunctiveCriterion.From(System.Collections.Generic.IEnumerable`1<JetBrains.ReSharper.UnitTestFramework.Criteria.IUnitTestElementCriterion>)'.

--- EXCEPTION #1/3 [MissingMethodException]
Message = “Method not found: 'JetBrains.ReSharper.UnitTestFramework.Criteria.IUnitTestElementCriterion JetBrains.ReSharper.UnitTestFramework.Criteria.DisjunctiveCriterion.From(System.Collections.Generic.IEnumerable`1<JetBrains.ReSharper.UnitTestFramework.Criteria.IUnitTestElementCriterion>)'.”
ExceptionPath = Root.InnerException.InnerException
ClassName = System.MissingMethodException
HResult = COR_E_MISSINGMETHOD=80131513
Source = ReSharperPlugin.SpecflowRiderPlugin
StackTraceString = “

at ReSharperPlugin.SpecflowRiderPlugin.UnitTestExplorers.SpecFlowTestsDataRules.GetSpecFlowUnitTestElements(IDataContext context)
at JetBrains.Application.DataContext.DataRule`1.JetBrains.Application.DataContext.IDataRule.Evaluate(IDataContext context)
at JetBrains.Application.DataContext.DataContext.Evaluator.TryEvaluateDataRules(IDataConstant constant, IDataContext dataContext, DataContextValidator validator)

--- Outer ---

--- EXCEPTION #2/3 [InvalidOperationException]
Message = “Failed to evaluate the data rule.”
ExceptionPath = Root.InnerException
ClassName = System.InvalidOperationException
InnerException = “Exception #1 at Root.InnerException.InnerException”
HResult = COR_E_INVALIDOPERATION=80131509

--- Outer ---

--- EXCEPTION #3/3 [LoggerException]
Message = “Failed to evaluate the data rule.”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
InnerException = “Exception #2 at Root.InnerException”
HResult = COR_E_APPLICATION=80131600
StackTraceString = “

at JetBrains.Util.LoggerBase.Log(LoggingLevel level, String message, Exception ex)
at JetBrains.Util.Logging.Logger.LogException(Exception ex)
at JetBrains.Application.DataContext.DataContext.Evaluator.TryEvaluateDataRules(IDataConstant constant, IDataContext dataContext, DataContextValidator validator)
at JetBrains.Application.DataContext.DataContext.DoGetData(IDataConstant constant)
at JetBrains.Application.DataContext.DataContext.JetBrains.Application.DataContext.IDataContext.GetData[T](DataConstant1 dataConstant) at JetBrains.ReSharper.UnitTestFramework.Actions.UnitTestRunBaseAction.Update(IDataContext context, ActionPresentation presentation, DelegateUpdate nextUpdate) at JetBrains.Application.UI.ActionsRevised.Handlers.ExecutableActionEvaluator.Evaluate(IAction handler, EvaluatedAction result, IDataContext context) at JetBrains.ReSharper.Feature.Services.Actions.ServicesActionEvaluator.Evaluate(IAction handler, EvaluatedAction result, IDataContext context) at JetBrains.Application.UI.ActionsRevised.Handlers.BoundAction.Evaluate(IDataContext context) at JetBrains.Platform.RdFramework.Actions.Backend.RdActions.CreateEvaluatedActionDescriptor(IActionDefWithId actionDefWithId, IDataContext dataContext, IActionHandlers handlers) at JetBrains.Platform.RdFramework.Actions.Backend.RdActionsAsyncAvailability.UpdateAction(ActionUpdateRequestData req, IDataContext dataContext) at JetBrains.Platform.RdFramework.Actions.Backend.RdActionsAsyncAvailability.UpdateOnBackgroundThread(IPriorityQueue1 actionsToUpdate)
at JetBrains.Application.Threading.Tasks.TaskHost.AccessViolationCatcher(Action action)
at JetBrains.Application.Threading.Tasks.TaskHost.<>c__DisplayClass36_0.b__1(Object state)
at System.Threading.Tasks.Task.Execute()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at JetBrains.Application.Threading.Tasks.Scheduler.JetScheduler.ExecuteTask(Task task)
at JetBrains.Application.Threading.Tasks.Scheduler.JetSchedulerThread.EnqueueNextTask()
at JetBrains.Application.Threading.Tasks.Scheduler.JetSchedulerThread.ThreadPoolProc()
at JetBrains.Util.Reflection.CallStackAnnotation.CatchAnnotatedInvocation[TClassOfNewFrame](String methodNameOfNewFrame, Action actionToAnnotate)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

last.action = null

app.eap = false
app.internal = true
app.build = RD-213.6461.51
app.version.major = 2021
app.version.minor = 3.2
app.build.date = 2021-12-22T16:40:05.465+0000
app.build.date.release = 2021-12-08T00:00:05.465+0000
app.build.date.release = 2021-12-08T00:00:05.465+0000
app.product.code = RD

os.name = Windows 11
os.cpu.arch = amd64
java.version = 11.0.13
java.vm.vendor = JetBrains s.r.o.

UIUtil.isRetina = false
JBUI.isHiDPI() = false
ImageScaleFactor = 1

netcore = false

.NET Framework 4.0.30319.42000

@patiqs
Copy link
Author

patiqs commented Jan 3, 2022

@patiqs
Copy link
Author

patiqs commented Jan 3, 2022

I tried to reproduce the issue by creating a project from template and adding a secondary .cs file to the 'Calculator.feature' as a dependent file.
This case right clicking the 'Calculator.feature' will reach the last row of SpecFlowTestsDataRules.GetSpecFlowUnitTestElements which is reported.
I don't get exception.

@patiqs
Copy link
Author

patiqs commented Jan 3, 2022

However The 'Run Unit Test' command is grayed when I right click the 'Calculator.feature' or even the 'Calculator.feature.cs'.

@patiqs
Copy link
Author

patiqs commented Jan 3, 2022

For me it seems that the tests in the generated file is not recognized. When I modify the test method to e.g:"AddTwoNumbers_", then right click allows to run the tests. (At least it seems because my modifications gets overwritten by SpecFlow) So I think that somehow the generated code is not recognized properly

@Socolin
Copy link
Collaborator

Socolin commented Jan 14, 2022

Hello

I'm not able to reproduce your issue. Can you share us a zip file or a git repo with the project that does not works ?

image

Also which version of Rider and which version of the plugin are you using ?
You can find those information in Help > About
image
And in the 'Plugins' settings
image

This error is verry similar to another one that was fixed with the 1.10.2 version of the plugin.

@patiqs
Copy link
Author

patiqs commented Jan 17, 2022

Hi Socolin,
I have the same Rider and plugin version. I tried to create sample project, however I found a weird behavior. https://tricentisgmbh-my.sharepoint.com/:v:/g/personal/s_tardi_tricentis_com/Eac-ShPnn6tBtINrv-uKaWoBhZ5kE86eJFJdLhRV-QlY6g

I created a project from template. The menu item is missing when I just simply try to open it. 00:00-00:30
I created a copy of the .sln file. It magically works. Please check: 00:40 - 01:10
I retried the original sln again. Doesn't work. 01:15 - 01:40

I think it must be a cache or something in Rider

@Socolin
Copy link
Collaborator

Socolin commented Jan 17, 2022

If it's cache things does it fix the problem to Invalidate rider cache ?

image

@patiqs
Copy link
Author

patiqs commented Jan 25, 2022

Yes. Invalidate Cache is the solution.
Thanks

@patiqs patiqs closed this as completed Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants