JustCode lists error "Unknown Method" when using named parameters and an extension method.

12 posts, 0 answers
  1. Jeff
    Jeff avatar
    1 posts
    Member since:
    Jun 2011

    Posted 27 Jul 2011 Link to this post

    In my C# / .NET 4 project, I have an extension method defined with the following signature:

        public static PFPrincipal Setup(this PFPrincipal principal, string name = "TEST", long userId = 1, long company = 1, string loginType = "P", LoginOrigin loginOrigin = LoginOrigin.Unspecified, long? subscriptionId = null, params string[] roles)<br>

    In my code, I use this extension method by specifying some of the named parameters:

          PFPrincipal.Current.Setup(loginOrigin: LoginOrigin.WebService, subscriptionId: 1);

    JustCode marks this in the Errors window as:

    C#: Unknown method 'Setup(loginOrigin:=MyApp.DataTypes.LoginOrigin, subscriptionId:=int)' of 'MyApp.Security.PFPrincipal'

    The actual code compiles and runs fine, only JustCode does not like it.
  2. Stefan Avramov
    Admin
    Stefan Avramov avatar
    41 posts

    Posted 28 Jul 2011 Link to this post

    Hi Jeff,

     Thanks for the feedback. We logged the issue for fixing and added a PITS item for you here. You also receive some Telerik Points.

    Best wishes,
    Stefan Avramov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
  4. ajpetersen
    ajpetersen avatar
    21 posts
    Member since:
    Dec 2010

    Posted 24 Aug 2011 Link to this post

    I think I am having the same problem as above, but I wasn't sure. I am using vb.net and I have a property that is defined in a Module.

    Public ReadOnly Property _IsReportingToTr(dealerInfo As DealerInfo) As Boolean
        Get
            Dim trService As New TraceRegisterService()
            If DealerInfo.TraceRegisterID Is Nothing Then
                Return False
            Else
                Return trService.GetTraceRegisterAccountById(DealerInfo.TraceRegisterID).IsReportingToTr
            End If
        End Get
    End Property
    'This is where I call it. _ActiveDealerInfo calls another property that gets the Active Dealer Info
    _IsReportingToTr(_ActiveDealerInfo)

    JustCode is giving me an error: Unknown Method '_IsReportingToTr'

    Other properties in the module run fine and don't show errors as long as a parameter is not being passed through.

    The project compiles and runs fine.
  5. ajpetersen
    ajpetersen avatar
    21 posts
    Member since:
    Dec 2010

    Posted 29 Aug 2011 Link to this post

    Is this the same issue?
  6. Stefan Avramov
    Admin
    Stefan Avramov avatar
    41 posts

    Posted 30 Aug 2011 Link to this post

    Hi Claude,

    Sorry for the late reply. No - this is a different issue. Can you send us a compilable sample where this occurs. The code you provided generates a real build error - "Property access must assign to the property or use its value". JustCode shows no errors if we fix the error by adding a variable there like so:

    Dim a = _IsReportingToTr(_ActiveDealerInfo)

    Thanks in advance.

    Regards,
    Stefan Avramov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  7. ajpetersen
    ajpetersen avatar
    21 posts
    Member since:
    Dec 2010

    Posted 30 Aug 2011 Link to this post

    Winform's Code Behind:
     
    Sorry if the first code sample did not compile. This sample defiantly does and JustCode still gives
    the Unknown method '_IsReportingToTr'

       
    Private Sub frmSendData_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
            If _IsReportingToTr(_ActiveDealerInfo) Then
                LoadLvBatches(Nothing, Nothing)
            Else
                HideTrControls()
            End If
          End Sub
     
     
    Module Properties:
     
         Public ReadOnly Property _IsReportingToTr(dealerInfo As DealerInfo) As Boolean
            Get
                Dim trService As New TraceRegisterService()
                If dealerInfo.TraceRegisterID Is Nothing Then
                    Return False
                Else
                    Return trService.GetTraceRegisterAccountById(dealerInfo.TraceRegisterID).IsReportingToTr
                End If
            End Get
        End Property
     
     
        Public Property _ActiveDealerInfo() As DealerInfo
            Get
                DiService = New DealerInfosService()
                Return DiService.GetActiveDealerInfo()
            End Get
            Set(value As DealerInfo)
                DiService.SaveDealerInfo(value)
            End Set
        End Property
  8. Stefan Avramov
    Admin
    Stefan Avramov avatar
    41 posts

    Posted 01 Sep 2011 Link to this post

    Hi Claude,

    Thanks a lot for taking the time to help us. We managed to reproduce the issue and logged it for fixing. I created a PITS item for you here. You also receive some Telerik Points to compensate you for the effort.

    Kind Regards,
    Stefan Avramov
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  9. Dinis
    Dinis avatar
    2 posts
    Member since:
    Dec 2012

    Posted 06 Dec 2012 Link to this post

    Has this been fixed?

    I just installed JustCode and am having the exact same problem (none of my Extension methods are working)
  10. Dinis
    Dinis avatar
    2 posts
    Member since:
    Dec 2012

    Posted 06 Dec 2012 Link to this post

    For a screenshot of the problem I had see the Just tried JustCode and its a shame they don't support ExtensionMethods blog post
  11. Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 07 Dec 2012 Link to this post

    Hello,

     Thanks for the feedback Dinis.
    I reproduced your issue and it seems that JustCode does not look for dll references in the Bin folder and that is why it shows the errors. If you add a reference to the O2_FluentSharp_CoreLib.dll the errors will disappear. I will make an item for this issue and we will investigate it.

    I would like to ask you what is the type of your TM_Website project?
    Thank you.

    Greetings,
    Zdravko
    the Telerik team
    Share what you think about JustCode with us, so we can help you even better! You can use the built-in feedback tool inside JustCode, our forum, or our JustCode feedback portal.
  12. Developers
    Developers avatar
    1 posts
    Member since:
    Jan 2012

    Posted 24 Jun 2013 Link to this post

    JustCode could not find  references in its bin folder, it ended up with Unknown Method Errors,   this issue is fixed or not ? but I upgrade JustCode today, the problem still exist. that is very annoying. is there another approach to get rid of this warning ?
  13. Ivan
    Admin
    Ivan avatar
    106 posts

    Posted 27 Jun 2013 Link to this post

    Hi,

    We have fixed the issue and the fix will be released in our next internal build.
    Thank you for your help!

    Regards,
    Ivan
    Telerik
    Share what you think about JustCode with us, so we can help you even better! You can use the built-in feedback tool inside JustCode, our forum, or our JustCode feedback portal.
Back to Top
DevCraft banner