1

I installed a sitecore instance with SIM, and checked the project for a MVC solution, what I don't get is why the @Html.Sitecore() is not working:

Error   2   'System.Web.WebPages.Html.HtmlHelper' does not contain a definition for 'Sitecore' and no extension method 'Sitecore' accepting a first argument of type 'System.Web.WebPages.Html.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)

I have the /Views/Web.config with the following:

  <namespaces>
    <add namespace="Sitecore.Mvc" />
    <add namespace="System.Web.Mvc" />
    <add namespace="System.Web.Mvc.Ajax" />
    <add namespace="System.Web.Mvc.Html" />
    <add namespace="System.Web.Routing" />
  </namespaces>

Is there something different that needs to be done when running a solution inside the "Website" folder vs publishing to the Website folder?

Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
thematt
  • 185
  • 1
  • 2
  • 15
  • Your project needs to reference Sitecore.Kernel and Sitecore.Mvc dlls – Marek Musielak Feb 19 '15 at 14:34
  • Those DLL's are in the references folder and are also in the /bin – thematt Feb 19 '15 at 14:59
  • Which Sitecore version you use exactly? – Marek Musielak Feb 19 '15 at 16:15
  • Went through this a while back. This might be helpful http://stackoverflow.com/questions/24147846/system-web-webpages-html-htmlhelper-does-not-contain-a-definition-for-sitecor – Martin Davies Feb 19 '15 at 17:47
  • Sitecore version 7.5 (latest), VS 2013 V4 MVC4 – thematt Feb 19 '15 at 18:09
  • Have you found the solution? We are also facing the same Issue. Sitecore 8.0, MVC 5, VS 2013 V3. I have already tried the options suggested in Sean Holmesby's Blog. But nothing works. The pages are displaying fine on browser. Issue is with the Intellisense only. – Maulik Darji Mar 26 '15 at 06:23
  • 1
    go to references locate sitecore.mvc > properties > set copy local to true – Amro Mustafa Jul 03 '19 at 12:27
  • I am preserving the following link in case it is deleted from an answer: http://www.seanholmesby.com/fixing-visual-studio-intellisense-in-sitecore-mvc-views/ – halfer Nov 23 '19 at 08:41

0 Answers0