Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Daniel Quick 22 posts 74 karma points
    May 19, 2014 @ 09:29
    Daniel Quick
    0

    IPublishedContent error

    Hello

    I am using EZSearch in 7.1.1, and am receiving the following error regarding the references to IPublishedContent.

    I believe that this is now referenced differently by the core team:

    Error 2 The type or namespace name 'IPublishedContent' could not be found (are you missing a using directive or an assembly reference?)

     

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    May 19, 2014 @ 09:56
    Matt Brailsford
    1

    Hi Daniel,

    You can either make sure Umbraco.Core.Models is listed in the namespaces within Views > Web.config (which it should be by default, and why it isn't referenced directly), or reference it directly in the ezSearch.cshtml file at the top by doing @using Umbraco.Core.Models.

    This should make the reference available to to the script.

    Hope this helps

    Matt

  • Daniel Quick 22 posts 74 karma points
    May 20, 2014 @ 13:30
    Daniel Quick
    0

    Thanks for that - we are definitely moving  in the right direction -IPublishedContent is now found in the assembly, but the version of it that is being referenced is missing some "belle" definitions and methods. e.g.:

    'Umbraco.Core.Models.IPublishedContent' does not contain a definition for 'AncestorOrSelf' and no extension method 'AncestorOrSelf' accepting a first argument of type 'Umbraco.Core.Models.IPublishedContent' could be found (are you missing a using directive or an assembly reference?)
     
    'Umbraco.Core.Models.IPublishedContent' does not contain a definition for 'GetPropertyValue' and no extension method 'GetPropertyValue' accepting a first argument of type 'Umbraco.Core.Models.IPublishedContent' could be found (are you missing a using directive or an assembly reference?)
     

    Perhaps a conflict between the version in two namespaces after recent core updates?

    Unfortunately this is making coding in views rather difficult, as the methods and extensions , particularly for traversing are not working.

     

  • Daniel Quick 22 posts 74 karma points
    May 20, 2014 @ 15:28
    Daniel Quick
    0

    Resolved thanks, there was a temporary file in app data that did not contain the correct using statement, this was triggering the errors

  • Ricardo Cardeña 5 posts 104 karma points
    Jul 13, 2016 @ 02:59
    Ricardo CardeƱa
    0

    hi, i have the same issue, how did you fix it ?

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    May 20, 2014 @ 15:30
    Matt Brailsford
    0

    Hey Daniel,

    Great stuff. Yea, those are all extension methods, which annoyingly VS doesn't always auto resolve them for you so you just need to make sure you have a using statement for Umbraco.Core aswell.

    Glad it's now working for you though.

    Matt

  • Daniel Quick 22 posts 74 karma points
    May 20, 2014 @ 17:42
    Daniel Quick
    0

    Thanks for all your help!

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    May 20, 2014 @ 17:45
    Matt Brailsford
    0

    Hey Daniel,

    No problem, please consider accepting an answer as the solution if any of them fixed your issue for you, just incase anyone has the same problem in future.

    Many thanks

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft