title: Any collection causes silent failure with 500 status code in Asp.Net MVC 4 RC Web API
body: <p>I'm completely lost on what could be causing this. </p>
  
  <p>I have an ASP.Net MVC 4 RC application and I have a set of Web API controllers. I'm trying to return an object that contains a set of child objects in an IList. Whenever I request the object I get a 500 error back on the browser with no noticeable exception thrown in the debugger. I've tried putting an Application_Error handler in the global.asax and no error is caught there either. </p>
  
  <p>It doesn't matter whether the List is an actual database relation or just a hard coded list of strings, in either case the request fails. If i set the list to null the request succeeds. </p>
  
  <p>If i remove the list the request succeeds and I get an XML (or JSON) representation of the object. </p>
  
  <p>I've also tried this line - </p>
  
  <pre><code>GlobalConfiguration.Configuration.IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always;
  </code></pre>
  
  <p>To capture the actual exception and still get nothing back. </p>
  
  <p>Here's the current object </p>
  
  <pre><code>public class Authority : IEntity
  {
      public virtual int Id { get; set; }
      public virtual string Name { get; set; }
      public virtual string Address1 { get; set; }
      public virtual string Address2 { get; set; }
      public virtual string City { get; set; }
      public virtual string County { get; set; }
      public virtual string State { get; set; }
      public virtual string ContactPostalCode { get; set; }
  
      //public virtual IList&lt;PostalCode&gt; PostalCodes { get; set; }
      public virtual IList&lt;string&gt; RandomTrash { get; set; }
  
      public VPA()
      {
          //PostalCodes = new List&lt;PostalCode&gt;();
          RandomTrash = new List&lt;string&gt; {"foo"};
      }
  }
  </code></pre>
  
  <p>Note the commented out PostalCodes collection - that is a real many to many database relationship. I commented it out and replaced it with the dummy "RandomTrash" collection and the failure seems to be the same.</p>
  
  <p>I have a feeling this is a serialization failure somehow but I can't figure out how to avoid it. If it helps I'm using NHibernate as the ORM. </p>
  
  <p>Has anyone seen this?</p>