I work on a large Visual Studio Solution (Sitecore Helix), with separate "feature" Projects. Some Projects have a Views > Web.config file and others do not.
During our build process, all Views end up one location/project and in that final destination the Views folder does have it's production Web.config file.
However, without a Views > Web.config file at individual the Project, there is no IntelliSense for the (dynamic) @model
. Strongly typed Objects (@Html.Raw
) have autocomplete/IntelliSense. As a front-end person, I really rely on the IntelliSense.
Is there a better/more appropriate way of adding these references other than to adding an individual Web.config (example below) to each Project, especially since I just need this for debug/development.
Example Web.config, please note this is not my entire Web.config file, but specifically the lines I have narrowed down to make the IntelliSense work in this case.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
</sectionGroup>
</configSections>
<system.web.webPages.razor>
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<pages pageBaseType="System.Web.Mvc.WebViewPage">
<namespaces>
<add namespace="Sitecore.Mvc" />
<add namespace="Sitecore.Mvc.Presentation" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="GCC.Feature.WebAdmin" />
</namespaces>
</pages>
</system.web.webPages.razor>
</configuration>
IntelliSense working on something other than @model