title: Glass Mapper not loading Model for View Rendering in Staging Area
body: <p>Using Sitecore 6.6 and Glass 3.0</p>
  
  <p>I've made a MVC layout which uses a View Rendering via Glass. I'm trying to show Highlights.</p>
  
  <p>I've made a View Rendering named GlassHighlights which has the following fields set:</p>
  
  <ul>
  <li>Path: <code>/Views/Renderings/KRN/GlassHighlight.cshtml</code></li>
  <li>Model: <code>/sitecore/layout/Models/KRN/Highlights</code></li>
  </ul>
  
  <p>The Model in Sitecore is has the following field set:
  Model Type: <code>Models.Sitecore.Content.Items.HighLights.Models</code></p>
  
  <p>The View Rendering is placed on Layout Details on an item named GlassTest (among some other renderings) and placed on placeholder 'body'. The datasource is set to the correct subfolder in sitecore.</p>
  
  <p>This is the model as it is defined in C#:</p>
  
  <pre class="lang-cs prettyprint-override"><code>using System.Collections.Generic;
  using Glass.Mapper.Sc.Configuration.Attributes;
  
  namespace Models.Sitecore.Content.Items
  {
      /// &lt;summary&gt;
      /// Container folder for the highlights
      /// &lt;/summary&gt;
      [SitecoreType(AutoMap = true)]
      public class HighLights
      {
          /// &lt;summary&gt;
          /// Collection of Highlight items
          /// &lt;/summary&gt;
          [SitecoreQuery(".//*[@@TemplateId='{EA8BF7CA-157F-4CF4-A2D8-36242304E8FA}']", IsRelative = true)]
          public virtual IEnumerable&lt;Highlight&gt; Items { get; set; }       
      }
  }
  </code></pre>
  
  <p>This is the razorview as it is defined in the project:</p>
  
  <pre><code>@inherits Glass.Mapper.Sc.Web.Mvc.GlassView&lt;Models.Sitecore.Content.Items.HighLights&gt;    
  
  &lt;div class="row topHWContainer"&gt;
      @{
          foreach (var highlight in Model.Items)
          {
          &lt;div class="four columns topHW column-first"&gt;
              &lt;a href="/eenheiddetails/@highlight.PublicatieID"&gt;
                  &lt;img src="/Style/Images/bgkArrowRightBlack.png" alt="bgkArrowRightBlack" width="19" height="14"&gt;
                  &lt;label&gt;@highlight.Titel&lt;/label&gt;
                  &lt;img src="@highlight.AchterGrondImage.Src" alt="Pimpernel" width="302" height="218" class="topHWimg"&gt;
                  &lt;div class="topHWinfo"&gt;
                      &lt;label&gt;@highlight.Plaats € @highlight.Huur&lt;/label&gt;
                  &lt;/div&gt;
              &lt;/a&gt;
          &lt;/div&gt;                       
          }
      }
  &lt;/div&gt;
  </code></pre>
  
  <p>The code may not be entirely optimal on places as I'm experimenting with things.</p>
  
  <p>Now here's the rub: when I run the website on local it works perfectly fine. Everything renders as it's supposed to render, all data is filled with what is supposed to come out of Sitecore.</p>
  
  <p>When I deploy to staging, the Model doesn't fill and I get a null reference exception when it tries to start the foreach. The Model itself isn't null, but Model.Items is null. Why does this happen? I would like to point out that my local points to the Sitecore Master and the Staging points to Web; but I've deployed every item involved. Did I oversee something?</p>
  
  <p>Why is local working and staging not?</p>