locked
Overload resolution failed because no accessible 'Where' is most specific for these arguments RRS feed

  • Question

  • User1280950372 posted

    Overload resolution failed because no accessible 'Where' is most specific for these arguments:

    Extension method 'Public Function Where(predicate As Expression(Of Func(Of PlannerGoal, Boolean))) As IQueryable(Of PlannerGoal)' defined in 'Queryable': Not most specific.
    Extension method 'Public Function Where(predicate As Func(Of PlannerGoal, Boolean)) As IEnumerable(Of PlannerGoal)' defined in 'Enumerable': Not most specific.

    I'm receiving the above error from the following line of code:

    Dim goalList As IQueryable(Of PlannerGoal) = _builder.GetGoalsByPlan(_thisStrategy.PlannerGoal.PlannerPlan, ActiveStatusFilterType.Active).Where((Function(g) g.ID <> _thisStrategy.PlannerGoalID))

    This is an inherited project so I don't know what to do. Any clues on how to start debugging the error?

    Tuesday, May 24, 2016 5:16 PM

Answers

  • User-2057865890 posted

    Hi muybn,

    You have made a call to an overloaded method, but the compiler has found two or more overloads with parameter lists to which your argument list can be converted, and it cannot select among them.

    To correct this error

    1.Review all the overloads for the method and determine which one you want to call.

    2.In your calling statement, make the data types of the arguments match the data types of the parameters defined for the desired overload.

    reference: Overload resolution failed because no accessible '<method>' is most specific for these arguments:<error>

    Best Regards,

    Chris

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 25, 2016 5:07 AM