While working on a Helix implementation or even regular Sitecore implementation I came across various intellisense issues in Visual Studio. Some of them are descriptive and some of them aren't. Here are few sample errors that you might come across:
- The type or namespace name 'Helpers' does not exist in the namespace 'System.Web' .
- The type or namespace name 'xyz' does not exist in the namespace 'System.Web.Mvc'.
- 'System.Web.Mvc' doesn't contain a definition for Sitecore and no extension method Sitecore accepting first argument of type.....
You should be able to resolve this issue by following one or more of these steps:
- Update your view's Web.config file with Sitecore's Web.config file as below. Make sure to clean and rebuild the solution once done.
- Once you add the config file and if you are still experiencing issues make sure that the referenced dll is added to the solution. For ex: As above error if it complain about System.Web.dll make sure that it's referenced properly by Nuget.
- Make sure that the dll exists in the bin directory. If not set the Copy Local property in Visual Studio for the dll. Specially for Sitecore make sure that Sitecore.Kernel, Sitecore.Mvc, System.Web, System.Web.Mvc, Glass Mapper dlls(if you are using glass) are referred in the solution.
- In VS 2017 when I experienced this issue I resolved it by updating the DotNetCompilerPlatform by adding one more compiler option in the web.config. The default is 1659;1699;1701;
I added 1702 as below: