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.
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.
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.
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.
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?)
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
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?
Resolved thanks, there was a temporary file in app data that did not contain the correct using statement, this was triggering the errors
hi, i have the same issue, how did you fix it ?
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
Thanks for all your help!
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
is working on a reply...