Auto Intelligence in VisualStudio 2015 in Sitecore Project

In my Visual 2013 solution, I had an Asp.net MVC 5 Sitecore Project, I found that in the View (.cshtml) Page is intillence not working at all for Sitecore Helper class. But in the controller the intellince was working fine. I read in many blog after restarting Visual Studio this problem goes away, But my intellience problem didn’t fixed.

Below is the resolution which i found, and is working in my project.

1) Include the Sitecore Web.Config file in your project.
2) Include the Sitecore /Views/Web.Config file in your Views folder.
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<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>
</pages>
</system.web.webPages.razor>

3) Ensure Sitecore.Kernel.DLL and Sitecore.Mvc.DLL are referenced in your project, and are set to CopyLocal=true.
Note:- If we make copylocal=true, at the time of Publishing Website, this dll get published.Inorder to avoid this we can make changes in TDS Project, Where we can exclude all the Sitecore.*.dll

By doing this the DLLs are copied to the project’s bin directory, but they’re not published in website Bin Directory.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.